/* ============================================
   Vietlott AI Predictor - Styles
   Design: Dark Mode (OLED) with vibrant accents
   ============================================ */

:root {
    --primary: #7C3AED;
    --primary-dark: #6D28D9;
    --primary-light: #A78BFA;
    --accent: #F59E0B;
    --accent-dark: #D97706;
    --cta: #F43F5E;
    --success: #10B981;
    --danger: #EF4444;
    --info: #06B6D4;
    --bg: #0F0F23;
    --bg-card: #1A1B3A;
    --bg-card-hover: #242654;
    --bg-elevated: #22234A;
    --text: #E2E8F0;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --border: #2D2F5E;
    --border-light: #3D3F7E;
    --gradient-1: linear-gradient(135deg, #7C3AED, #A78BFA);
    --gradient-2: linear-gradient(135deg, #F59E0B, #F43F5E);
    --gradient-3: linear-gradient(135deg, #10B981, #06B6D4);
    --gradient-hero: linear-gradient(135deg, #7C3AED 0%, #3B82F6 50%, #06B6D4 100%);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
    background-attachment: fixed;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Header
   ============================================ */
.header {
    background: rgba(15, 15, 35, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(124, 58, 237, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 0;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    color: var(--text);
    white-space: nowrap;
}

.logo i {
    font-size: 1.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    display: flex;
    gap: 4px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(124, 58, 237, 0.12);
}

.nav-link.active {
    color: white;
    background: var(--gradient-1);
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.4);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Game select dropdown with custom arrow */
.game-select {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.25s;
    font-family: 'Inter', sans-serif;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394A3B8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.game-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.game-select:hover {
    border-color: var(--border-light);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    color: white;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    border-color: var(--border-light);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--gradient-1);
    border: none;
    box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
}

.btn-accent {
    background: var(--gradient-2);
    border: none;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.3);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
}

/* ============================================
   Main Layout
   ============================================ */
.main {
    padding: 24px 0;
    min-height: calc(100vh - 64px - 80px);
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Stats Grid
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
}

/* Colored top border accent shown on hover */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow), var(--shadow-glow);
    border-color: var(--border-light);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:nth-child(1)::before { background: var(--gradient-1); }
.stat-card:nth-child(2)::before { background: var(--gradient-3); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #8B5CF6, #EC4899); }
.stat-card:nth-child(4)::before { background: var(--gradient-2); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.bg-blue { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.bg-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.bg-purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.bg-orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Monospace font for numbers */
.stat-value {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(124, 58, 237, 0.03);
}

.card-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}

.card-header h2 i {
    color: var(--primary-light);
    font-size: 1.1rem;
}

.card-body {
    padding: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ============================================
   Lottery Balls
   ============================================ */
.ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.95rem;
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 3px 12px rgba(124, 58, 237, 0.35);
    margin: 4px;
    transition: all 0.25s ease;
    cursor: default;
}

.ball:hover {
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.ball.power {
    background: var(--gradient-2);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.ball.hot {
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.ball.cold {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.ball.overdue {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.ball-sm {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
}

/* ============================================
   Top Prediction
   ============================================ */
.top-prediction .prediction-set {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(167, 139, 250, 0.06));
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.top-prediction .prediction-set:hover {
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.1);
}

.prediction-set .pred-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.pred-method {
    font-size: 0.85rem;
    color: var(--primary-light);
    font-weight: 600;
}

.pred-confidence {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.confidence-high { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.confidence-mid { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.confidence-low { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.pred-numbers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ============================================
   Predictions Grid
   ============================================ */
.predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.prediction-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.3s ease;
    cursor: default;
}

.prediction-card:hover {
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.12);
    transform: translateY(-2px);
}

.prediction-card .method-tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    font-weight: 600;
}

.tag-lstm { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.tag-ml { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.tag-stat { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.tag-ensemble { background: rgba(236, 72, 153, 0.2); color: #f472b6; }

/* ============================================
   Method Comparison
   ============================================ */
.method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.method-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.method-card h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.method-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* ============================================
   History Table
   ============================================ */
.history-table table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.history-table th {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-table tr:hover td {
    background: rgba(124, 58, 237, 0.08);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

#pageInfo {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   Hot/Cold Section
   ============================================ */
.hot-cold-section {
    margin-bottom: 20px;
}

.hot-cold-section h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.balls-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ============================================
   Charts
   ============================================ */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Frequency Bar */
.freq-bar-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 400px;
    overflow-y: auto;
}

.freq-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}

.freq-bar-label {
    width: 30px;
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.freq-bar-track {
    flex: 1;
    height: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.freq-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.freq-bar-value {
    width: 40px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   Pairs Grid
   ============================================ */
.pairs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.pair-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    transition: all 0.2s;
}

.pair-item:hover {
    border-color: var(--primary);
}

.pair-numbers {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.pair-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Sum Stats
   ============================================ */
.sum-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.sum-stat-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.sum-stat-item .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-light);
    font-family: 'JetBrains Mono', monospace;
}

.sum-stat-item .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   Overdue Numbers
   ============================================ */
.overdue-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ============================================
   Loading States
   ============================================ */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 35, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(124, 58, 237, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Toast
   ============================================ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.toast.error {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.toast.info {
    background: rgba(124, 58, 237, 0.9);
    color: white;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.footer p {
    margin: 4px 0;
}

.footer p:first-child {
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* ============================================
   Simulator
   ============================================ */
.sim-number-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 6px;
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

.sim-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.sim-num:hover {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.12);
    transform: scale(1.05);
}

.sim-num.selected {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
    transform: scale(1.12);
    box-shadow: 0 3px 12px rgba(124, 58, 237, 0.5);
}

.sim-selected-display {
    min-height: 56px;
    padding: 8px;
    background: rgba(124, 58, 237, 0.05);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sim-digit-input {
    margin-top: 16px;
}

.sim-digit-field {
    display: block;
    width: 100%;
    max-width: 200px;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'JetBrains Mono', monospace;
}

.sim-digit-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.sim-draw-result {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sim-match-box {
    text-align: center;
    padding: 20px;
    border-radius: var(--radius);
    margin-top: 12px;
}

.sim-match-box.win {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sim-match-box.lose {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.sim-match-emoji {
    font-size: 2rem;
    margin-bottom: 8px;
}

.sim-match-text {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.sim-match-prize {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

.sim-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.sim-stat {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

/* Monospace font for stat numbers */
.sim-stat-val {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-light);
}

.sim-stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ============================================
   Responsive - Tablet
   ============================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Responsive - Mobile
   ============================================ */
@media (max-width: 768px) {
    .header .container {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
        gap: 10px;
    }

    /* Nav scrolls horizontally with fade-out edge indicator */
    .nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        mask-image: linear-gradient(to right, black 90%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
    }

    .nav::-webkit-scrollbar { display: none; }

    .nav-link {
        font-size: 0.8rem;
        padding: 8px 14px;
        white-space: nowrap;
    }

    .container {
        padding: 0 16px;
    }

    .card-body {
        padding: 16px;
    }

    .card-header {
        padding: 14px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .predictions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .ball {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
    }
}

/* ============================================
   Accessibility - Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   AI Auto-Play Tab
   ============================================ */
.ap-banner {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(124, 58, 237, 0.2);
}
.ap-match-cell { font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.ap-match-cell.win { color: var(--success); }
.ap-match-cell.lose { color: var(--text-muted); }
.ap-row-win { border-left: 3px solid var(--success); }
.ap-row-win td:first-child { padding-left: 9px; }
