/* ================================
   SportsBet Analyzer - Premium Dark Theme
   ================================ */

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(99, 102, 241, 0.15);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #6366f1;
    --accent-secondary: #22d3ee;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #22d3ee);
    
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* === Background Orbs === */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

.bg-orb-1 {
    width: 600px;
    height: 600px;
    background: rgba(99, 102, 241, 0.08);
    top: -200px;
    right: -200px;
    animation: orbFloat1 20s ease-in-out infinite;
}

.bg-orb-2 {
    width: 500px;
    height: 500px;
    background: rgba(34, 211, 238, 0.06);
    bottom: -150px;
    left: -150px;
    animation: orbFloat2 25s ease-in-out infinite;
}

.bg-orb-3 {
    width: 400px;
    height: 400px;
    background: rgba(139, 92, 246, 0.05);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbFloat3 30s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-80px, 80px); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(60px, -60px); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* === Container === */
.container {
    position: relative;
    z-index: 1;
    max-width: 1800px;
    margin: 0 auto;
    padding: 24px;
}

/* === Header === */
.header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 20px 28px;
    margin-bottom: 24px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glow);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

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

/* === Status Badge === */
.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: background 0.3s;
}

.status-idle .status-dot { background: var(--text-muted); }
.status-scraping .status-dot { background: var(--warning); animation: pulse 1.5s infinite; }
.status-done .status-dot { background: var(--success); }
.status-error .status-dot { background: var(--danger); }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* === Primary Button === */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.stat-icon-matches { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.stat-icon-sources { background: rgba(34, 211, 238, 0.15); color: #22d3ee; }
.stat-icon-value { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon-time { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

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

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

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

/* === Progress Bar === */
.progress-container {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 100px;
    width: 0%;
    transition: width 0.8s ease;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-text {
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* === Filter Bar === */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-group select,
.filter-group input {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--accent-primary);
}

.filter-group input {
    width: 180px;
}

/* === Results Table === */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.results-table thead {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.results-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    user-select: none;
}

.results-table th.sortable {
    cursor: pointer;
    transition: color 0.2s;
}

.results-table th.sortable:hover {
    color: var(--accent-secondary);
}

.results-table th.active-sort {
    color: var(--accent-primary);
}

.sort-icon {
    font-size: 0.75rem;
    opacity: 0.5;
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.results-table tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

.results-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

/* Row variants */
.row-hot { border-left: 3px solid var(--success); }
.row-warm { border-left: 3px solid #6ee7b7; }
.row-mild { border-left: 3px solid #a7f3d0; }
.row-cold { border-left: 3px solid var(--text-muted); }
.row-neutral { border-left: 3px solid transparent; }

/* Fade-in animation disabled — rows render immediately */
.fade-in {
    animation: none;
    opacity: 1;
}

/* Cell styles */
.td-rank {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.8rem;
    width: 40px;
    text-align: center;
}

.td-match {
    min-width: 200px;
}

.match-teams {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.team-home {
    font-weight: 600;
    color: var(--text-primary);
}

.team-away {
    font-weight: 400;
    color: var(--text-secondary);
}

.vs {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 300;
}

.kickoff {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.td-league {
    max-width: 140px;
}

.league-badge {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 100px;
    font-size: 0.72rem;
    color: #a5b4fc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.td-odds {
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    text-align: center;
    min-width: 60px;
}

.td-prob {
    min-width: 140px;
}

.prob-mini {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.td-sources {
    text-align: center;
}

.sources-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.15);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
    color: #22d3ee;
}

.td-value {
    text-align: center;
    min-width: 80px;
}

.value-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.value-badge.neutral {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.td-bet {
    min-width: 100px;
}

.bet-tip {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #34d399;
    white-space: nowrap;
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}

.empty-icon {
    margin-bottom: 20px;
    color: var(--accent-primary);
    opacity: 0.3;
}

.empty-state h2 {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

/* === Modal === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.modal-visible {
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.modal-visible .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.detail-header {
    margin-bottom: 24px;
}

.detail-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-league {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.detail-comparison {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.detail-col {
    flex: 1;
    padding: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.detail-col h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.detail-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-odds {
    display: flex;
    gap: 8px;
}

.odd-box {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.odd-box.value-positive {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.odd-box.value-negative {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.03);
}

.odd-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.odd-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.odd-prob {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.odd-dev {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 2px;
}

.value-positive .odd-dev { color: var(--success); }
.value-negative .odd-dev { color: var(--danger); }

.margin-info {
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.detail-recommendation {
    padding: 16px;
    background: var(--success-soft);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.detail-recommendation h3 {
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.detail-recommendation p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.detail-sources {
    margin-top: 20px;
}

.detail-sources h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.detail-source {
    padding: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.detail-source h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-secondary);
    margin-bottom: 6px;
}

.detail-probs {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.detail-pred, .detail-conf {
    display: inline-block;
    margin-top: 4px;
    margin-right: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.no-data {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    z-index: 2000;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

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

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); color: #1a1a1a; }
.toast-info { background: var(--accent-primary); }

/* === Footer === */
.footer {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* === Navigation Button === */
.btn-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-nav:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
}

/* === Evaluation Page === */
.controls-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    backdrop-filter: blur(20px);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.eval-input {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.eval-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.stat-icon-eval { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.stat-icon-winloss { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon-staked { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.stat-icon-profit { background: rgba(34, 211, 238, 0.15); color: #22d3ee; }
.stat-icon-pending { background: var(--warning-soft); color: var(--warning); }
.stat-icon-unmatched { background: var(--danger-soft); color: var(--danger); }
.stat-icon-roi { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

.profit-positive { color: var(--success) !important; }
.profit-negative { color: var(--danger) !important; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.badge-won {
    background: var(--success-soft);
    color: var(--success);
    border-color: transparent;
}

.badge-lost {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: transparent;
}

.badge-running {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-color: transparent;
}

.badge-pending {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: transparent;
}

.badge-unmatched {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: transparent;
}

.exclude-tag {
    background: var(--danger-soft);
    color: var(--danger);
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.exclude-tag-remove {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
}

.exclude-tag-remove:hover {
    opacity: 1;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-heading svg {
    flex-shrink: 0;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-overlay .loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.loading-overlay h3 {
    color: var(--text-primary);
    margin-bottom: 6px;
}

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.exclude-banner {
    background: var(--danger-soft);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
    color: var(--danger);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exclude-banner svg {
    flex-shrink: 0;
}

.score-input {
    width: 70px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-align: center;
    font-family: inherit;
    font-size: 0.85rem;
}

.score-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.btn-sm:hover {
    background: var(--bg-card-hover);
}

.table-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* === Responsive === */

/* Tablet */
@media (max-width: 1024px) {
    .results-table {
        font-size: 0.8rem;
    }

    .th-prob, .td-prob {
        display: none;
    }

    .stat-card:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Performance: smaller orbs */
    .bg-orb-1 { width: 300px; height: 300px; }
    .bg-orb-2 { width: 250px; height: 250px; }
    .bg-orb-3 { display: none; }

    .container {
        padding: 10px;
    }

    /* Header */
    .header {
        padding: 14px 16px;
        border-radius: var(--radius-lg);
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .header h1 {
        font-size: 1.15rem;
    }

    .subtitle {
        font-size: 0.78rem;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }

    .logo-icon svg {
        width: 26px;
        height: 26px;
    }

    .header-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .header-actions > * {
        flex: 1 1 auto;
        min-width: 0;
    }

    .header-actions .btn-nav,
    .header-actions .btn-primary {
        justify-content: center;
        font-size: 0.82rem;
        padding: 10px 14px;
    }

    .header-actions .status-badge {
        justify-content: center;
        font-size: 0.78rem;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 12px 14px;
        gap: 10px;
        border-radius: var(--radius-md);
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* Filter bar */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
        border-radius: var(--radius-md);
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .filter-group select,
    .filter-group input {
        width: 100%;
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    /* Tables: horizontal scroll */
    .table-container {
        border-radius: var(--radius-lg);
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .results-table {
        font-size: 0.78rem;
    }

    .results-table th {
        padding: 10px 8px;
        font-size: 0.7rem;
    }

    .results-table td {
        padding: 10px 8px;
    }

    /* Dashboard table: needs min-width for scroll */
    #table-container .results-table {
        min-width: 600px;
    }

    /* Dashboard: hide less-important columns */
    .th-rank, .td-rank {
        display: none;
    }

    .th-odds:not(:first-of-type), .td-odds:not(:first-of-type) {
        display: none;
    }

    .th-league, .td-league {
        display: none;
    }

    .td-match {
        min-width: 140px;
    }

    .td-value {
        min-width: 65px;
    }

    .td-bet {
        min-width: 80px;
    }

    /* Evaluation tables: hide Tipp (3rd) and Quote (4th) columns */
    #evaluation-table th:nth-child(3),
    #evaluation-table td:nth-child(3),
    #running-table th:nth-child(3),
    #running-table td:nth-child(3),
    #pending-table th:nth-child(3),
    #pending-table td:nth-child(3),
    #evaluation-table th:nth-child(4),
    #evaluation-table td:nth-child(4),
    #running-table th:nth-child(4),
    #running-table td:nth-child(4),
    #pending-table th:nth-child(4),
    #pending-table td:nth-child(4) {
        display: none;
    }

    /* Controls panel */
    .controls-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 14px 16px;
        border-radius: var(--radius-md);
    }

    .controls-panel .input-group {
        min-width: 0 !important;
        flex: none !important;
    }

    .eval-input {
        width: 100% !important;
    }

    /* Section headings */
    .section-heading {
        font-size: 0.9rem;
        padding: 12px 14px;
    }

    /* Modal */
    .modal-content {
        width: 96%;
        max-height: 90vh;
        padding: 20px 16px;
        border-radius: var(--radius-lg);
    }

    .detail-comparison {
        flex-direction: column;
    }

    .detail-vs {
        display: none;
    }

    .detail-header h2 {
        font-size: 1.1rem;
        padding-right: 32px;
    }

    .detail-probs {
        flex-direction: column;
        gap: 4px;
    }

    .detail-odds {
        gap: 6px;
    }

    .odd-value {
        font-size: 1rem;
    }

    .detail-source {
        padding: 10px;
    }

    /* Toast: full width on mobile */
    .toast {
        left: 10px;
        right: 10px;
        bottom: 10px;
        text-align: center;
    }

    /* Empty state */
    .empty-state {
        padding: 48px 16px;
    }

    .empty-icon svg {
        width: 48px;
        height: 48px;
    }

    .empty-state h2 {
        font-size: 1.1rem;
    }

    /* Footer */
    .footer {
        padding: 20px 12px;
        font-size: 0.72rem;
    }

    /* Progress bar */
    .progress-container {
        padding: 12px 14px;
        border-radius: var(--radius-md);
    }

    /* Loading overlay */
    .loading-overlay h3 {
        font-size: 1rem;
    }

    /* Badges: compact */
    .badge {
        font-size: 0.72rem;
        padding: 3px 8px;
    }

    .value-badge {
        font-size: 0.72rem;
        padding: 3px 8px;
    }

    .league-badge {
        font-size: 0.68rem;
        max-width: 100px;
    }

    .bet-tip {
        font-size: 0.7rem;
        padding: 2px 8px;
    }

    .sources-count {
        width: 24px;
        height: 24px;
        font-size: 0.72rem;
    }

    /* Exclude */
    .exclude-banner {
        font-size: 0.78rem;
        padding: 10px 12px;
    }

    .exclude-tag {
        font-size: 0.72rem;
    }
}

/* Small phone */
@media (max-width: 480px) {
    .container {
        padding: 6px;
    }

    .header {
        padding: 12px;
        border-radius: var(--radius-md);
    }

    .header h1 {
        font-size: 1rem;
    }

    .logo-section {
        gap: 10px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
    }

    .logo-icon svg {
        width: 22px;
        height: 22px;
    }

    /* Stats: single column */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .stat-card {
        padding: 10px 12px;
    }

    /* Buttons: fully stacked */
    .header-actions {
        flex-direction: column;
    }

    .header-actions > * {
        width: 100%;
        flex: none;
    }

    /* Modal: bottom sheet */
    .modal {
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-height: 92vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding: 16px 12px;
    }

    .modal-close {
        top: 12px;
        right: 12px;
    }

    .odd-box {
        padding: 6px 3px;
    }

    .odd-value {
        font-size: 0.9rem;
    }

    .odd-label {
        font-size: 0.68rem;
    }

    .detail-col h3 {
        font-size: 0.78rem;
    }

    .detail-header h2 {
        font-size: 1rem;
    }

    /* Tables */
    .results-table {
        font-size: 0.75rem;
    }

    .results-table th {
        padding: 8px 6px;
        font-size: 0.68rem;
    }

    .results-table td {
        padding: 8px 6px;
    }

    .table-container {
        border-radius: var(--radius-md);
    }

    /* Section headings */
    .section-heading {
        font-size: 0.85rem;
        padding: 10px 12px;
    }

    /* Controls */
    .controls-panel {
        padding: 12px;
        border-radius: var(--radius-md);
    }

    /* Score input */
    .score-input {
        width: 60px;
        padding: 3px 6px;
        font-size: 0.78rem;
    }

    .filter-bar {
        padding: 10px 12px;
        border-radius: var(--radius-md);
    }

    .empty-state {
        padding: 36px 12px;
    }
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
