:root {
    --bg-color: #0d0f14;
    --card-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --text-main: #ffffff;
    --text-dim: #94a3b8;
    --win: #10b981;
    --loss: #ef4444;
    --draw: #f59e0b;
    --crimson: #991b1b;
    --accent: #ffd700;
    --glass-bg: rgba(255, 255, 255, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background Blobs */
.background-blob {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.12) 0%, transparent 70%);
    top: -250px;
    left: -250px;
    z-index: -1;
    pointer-events: none;
}

.blob-2 {
    top: auto;
    left: auto;
    bottom: -250px;
    right: -250px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 1rem 0;
    position: relative;
}

/* Typography & Links */
h1,
h2,
h3,
h4 {
    letter-spacing: -0.02em;
}

.logo-area h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.logo-area img {
    height: 48px;
    width: 48px;
    filter: drop-shadow(0 0 12px rgba(0, 243, 255, 0.4));
    border-radius: 10px;
    display: block;
}

.logo-area p {
    color: var(--text-dim);
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

.btn-update {
    background: linear-gradient(135deg, var(--primary), #4338ca);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.2);
}

.btn-update:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    text-decoration: none;
    padding: 0.6rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-nav {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
}

.btn-nav-small {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nav-small:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
}

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

/* Tabs */
.league-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.league-tabs::-webkit-scrollbar {
    display: none;
}

.league-tabs button {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 0.75rem 1.5rem;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.league-tabs button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.2);
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
}

/* Fixtures Grid */
.grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (max-width: 1000px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Standings Table */
.table-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    overflow-x: auto;
    scrollbar-width: thin;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1.25rem 1rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--glass-border);
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.team-cell img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* Fixture Lists */
.fixture-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fixture-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.fixture-date {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.matchup .team {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.matchup .team.home {
    justify-content: flex-end;
    text-align: right;
}

.matchup .team.away {
    justify-content: flex-start;
    text-align: left;
}

.matchup .team img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.matchup .score,
.matchup .vs {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 8px;
    font-weight: 800;
    min-width: 60px;
    text-align: center;
}

.matchup .vs {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

/* Predictions View */
.prediction-controls {
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 50;
}

.controls-row {
    display: flex;
    gap: 3rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 0 0 auto;
}

.control-group label {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-weight: 700;
}

.control-group select,
.control-group input[type="text"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    outline: none;
    font-size: 0.95rem;
    width: 100%;
}

.date-navigator {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    min-width: 340px;
}

.datepicker-container {
    position: relative;
    width: 240px;
}

.datepicker-container input {
    padding-right: 2.5rem !important;
}

.datepicker-container svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

.select-container {
    width: 160px;
    position: relative;
}

.league-multiselect {
    min-width: 180px;
}

/* Custom Dropdown Styling */
.custom-dropdown {
    position: relative;
    user-select: none;
}

.dropdown-trigger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #fff;
    min-width: 160px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 220px;
    background: rgba(20, 21, 26, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 8px;
    z-index: 1000;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Increased gap */
    padding: 12px 14px;
    /* Larger touch target */
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item label {
    display: flex;
    /* Ensure label content is flex */
    align-items: center;
    gap: 12px;
    width: 100%;
    cursor: pointer;
    margin: 0;
    /* consistent */
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
    width: 18px;
    /* Fixed size */
    height: 18px;
    min-width: 18px;
    /* Prevent shrinking */
}

.dropdown-item span {
    font-size: 0.95rem;
    /* Slightly larger text */
    color: var(--text-dim);
    line-height: 1.2;
    padding-top: 2px;
    /* Optical alignment */
}

.control-row-sep {
    height: 1px;
    background: var(--glass-border);
    width: 100%;
    margin: 1rem 0;
}

/* Status Badge Pulse */
.analysis-status-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(16, 185, 129, 0.08);
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.analysis-status-badge span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--win);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--win);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 2s infinite;
}

.pulse-dot.loading {
    background: var(--draw);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    animation: pulse-loading 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes pulse-loading {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* Prediction Grid */
.prediction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.prediction-card {
    position: relative;
    padding: 4.5rem 2rem 2.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.confidence-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
}

.predicted-winner .label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    display: block;
}

.winner-display {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.winner-display img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.winner-details h4 {
    font-size: 1.4rem;
    font-weight: 700;
}

.match-context {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 6px;
    font-weight: 500;
}

.stat-row .vs {
    opacity: 0.5;
    font-size: 0.75rem;
    font-weight: 800;
}

/* Sparklines */
.sparkline-container {
    display: flex;
    gap: 6px;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 10px;
}

.spark-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.spark-dot.w {
    background: var(--win);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.spark-dot.d {
    background: var(--draw);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.spark-dot.l {
    background: var(--loss);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.spark-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 8px;
}

/* Anatomy of a Pick */
.breakdown-toggle {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 12px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.breakdown-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.breakdown-content {
    margin-top: 1rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 16px;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.breakdown-row span:first-child {
    color: var(--text-dim);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
}

.breakdown-row span:last-child {
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}

/* Accumulator Premium */
.accumulator-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.acc-stat-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.25rem 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    text-align: center;
}

/* Model Methodology Restoration */
.model-methodology {
    padding: 3rem;
}

.model-methodology h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.logic-intro {
    color: var(--text-dim);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 900px;
}

.logic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
}

.logic-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

.logic-item p {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.6;
}

.logic-item .weight {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-light);
    margin-bottom: 1rem;
}

/* Floating Slip */
.floating-slip {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 380px;
    z-index: 2000;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.slip-header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-slip {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-slip:hover {
    opacity: 1;
}

.slip-body {
    padding: 1.25rem;
    max-height: 400px;
    overflow-y: auto;
}

.slip-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.remove-slip-item {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-slip-item:hover {
    background: #ef4444;
    color: white;
}

.slip-footer {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Accuracy Matrix Table */
.accuracy-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.accuracy-matrix tr td {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem 1rem;
}

.accuracy-matrix tr td:first-child {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.accuracy-matrix tr td:last-child {
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

.accuracy-bar-bg {
    height: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    width: 140px;
    overflow: hidden;
}

.accuracy-bar-fill {
    height: 100%;
    transition: width 1s;
}

/* Custom Slip Btn inside Card */
.custom-slip-btn {
    position: absolute;
    top: 5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 9999;
}

.custom-slip-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.custom-slip-btn.active {
    background: var(--win);
    border-color: transparent;
}

.predicted-winner {
    margin-top: 0.5rem;
}

/* Misc */
.status-badge {
    position: absolute;
    top: 1.25rem;
    left: 1.5rem;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-dim);
    z-index: 5;
}

/* Hide mobile filter toggle by default (Desktop) */
.mobile-filter-toggle {
    display: none;
}

/* --- Mobile Optimization --- */
@media (max-width: 768px) {

    /* Layout & Containers */
    .container {
        padding: 1rem;
        width: 100%;
        overflow-x: hidden;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Typography */
    .logo-area h1 {
        font-size: 2.2rem;
    }

    .logo-area p {
        font-size: 0.9rem;
        margin-top: 8px !important;
    }

    h2 {
        font-size: 1.8rem !important;
    }

    /* Header & Navigation */
    header {
        margin-bottom: 2rem;
        gap: 1.8rem;
    }

    .logo-area {
        flex-direction: column !important;
        text-align: center;
        gap: 1rem !important;
    }

    /* Stats container full width centering */
    .stats-container {
        width: 100% !important;
        margin: 0 !important;
    }

    .stats-group {
        width: 100% !important;
        padding: 12px !important;
        gap: 0.5rem !important;
        justify-content: space-between;
        background: rgba(255, 255, 255, 0.05) !important;
        display: flex !important;
    }

    .stat-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .stat-item span:first-child {
        font-size: 0.55rem !important;
    }

    .stat-item span:last-child {
        font-size: 1rem !important;
    }

    /* Header Actions Grid */
    .header-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 12px !important;
        width: 100%;
    }

    .btn-secondary,
    .btn-update {
        font-size: 0.95rem !important;
        padding: 12px !important;
        height: auto !important;
    }

    .sync-info-desktop {
        display: none !important;
    }

    .sync-action-group {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }

    .sync-info-mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        background: rgba(0, 0, 0, 0.2);
        padding: 4px;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.03);
    }

    .analysis-status-badge {
        grid-column: span 2;
        justify-content: center;
        margin: 0.5rem 0 0 0 !important;
    }

    /* Controls & Filters */
    .prediction-controls {
        padding: 1.25rem !important;
        margin-bottom: 2rem;
    }

    .controls-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .filters-desktop-only {
        display: none !important;
    }

    .checkbox-row {
        margin-top: 1.5rem;
    }

    /* Reset row override: The checkbox row should be 2 columns on mobile */
    .checkbox-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        align-items: stretch;
    }

    .control-group.checkbox {
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        background: rgba(255, 255, 255, 0.03);
        padding: 12px 10px;
        border-radius: 12px;
        border: 1px solid var(--glass-border);
        margin: 0 !important;
    }

    /* Select elements readability fix for dark mode */
    select {
        color: white !important;
        background-color: #1a1b21 !important;
        font-size: 1.1rem !important;
        padding: 14px 12px !important;
        border-radius: 12px !important;
        height: auto !important;
    }

    select option {
        background-color: #1a1b21 !important;
        color: white !important;
        font-size: 1.1rem !important;
        padding: 12px !important;
    }

    .select-container::after {
        right: 15px !important;
        font-size: 1rem !important;
    }

    /* Date controls on mobile */
    .date-navigator {
        min-width: 0 !important;
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
    }

    /* Reset button in checkbox row span 2 */
    .checkbox-row button {
        grid-column: span 2;
        width: 100% !important;
        height: 44px !important;
        margin-top: 8px;
    }

    /* Accumulator Summary */
    .accumulator-card {
        padding: 1.25rem !important;
    }

    .acc-title-group {
        width: 100%;
        justify-content: center;
        margin-bottom: 1rem;
    }

    .acc-stat-box {
        flex: 1;
        padding: 1rem !important;
        min-width: 120px;
    }

    .acc-stat-box span:last-child {
        font-size: 1.4rem !important;
    }

    /* Prediction Cards */
    .prediction-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .prediction-card {
        padding: 3.5rem 1.25rem 1.5rem 1.25rem;
    }

    /* How It Works Specifics */
    .feature-card {
        padding: 1.5rem !important;
    }

    .step-number {
        font-size: 2rem !important;
    }

    .floating-slip {
        width: 100%;
        left: 0;
        bottom: 0;
        right: 0;
        border-radius: 24px 24px 0 0;
        max-height: 85vh;
        z-index: 9999;
        border: none;
        border-top: 1px solid var(--glass-border);
    }
}

/* --- Visibility Utilities --- */
.mobile-only {
    display: none !important;
}

.mobile-league-selector {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }

    .league-tabs {
        display: none !important;
    }

    .mobile-league-selector {
        display: block;
        width: 100%;
        margin: 1.5rem 0;
        position: relative;
    }

    .league-info-btn {
        width: 100%;
        justify-content: space-between !important;
        padding: 14px 20px !important;
        border-radius: 16px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        font-weight: 700 !important;
        font-size: 1rem !important;
        border: 1px solid var(--glass-border) !important;
        display: flex;
        align-items: center;
        color: white;
    }

    .league-info-dropdown {
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        background: #1a1b21;
        border: 1px solid var(--glass-border);
        border-radius: 16px;
        z-index: 1000;
        padding: 8px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
        max-height: 400px;
        overflow-y: auto;
    }

    .league-info-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        border-radius: 10px;
        color: white;
        text-decoration: none;
        transition: 0.2s;
        border: none;
        background: rgba(255, 255, 255, 0.02);
        width: 100%;
        text-align: left;
        font-size: 0.95rem;
        font-weight: 600;
    }

    .league-info-item.active {
        background: var(--primary);
        color: white;
    }

    .league-info-item img {
        width: 24px;
        height: 24px;
        border-radius: 4px;
    }

    /* Select elements readability fix for dark mode */
    select {
        color: white !important;
        background-color: #1a1b21 !important;
        font-size: 1.1rem !important;
        padding: 14px 12px !important;
        border-radius: 12px !important;
        height: auto !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    select option {
        background-color: #1a1b21 !important;
        color: white !important;
    }

    /* Tooltip replacement for mobile */
    .mobile-tip {
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: #34495e;
        color: white;
        padding: 10px 14px;
        border-radius: 10px;
        font-size: 0.85rem;
        white-space: normal;
        min-width: 180px;
        z-index: 3000 !important;
        margin-bottom: 12px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.1);
        text-align: center;
        line-height: 1.4;
    }

    .mobile-tip::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        margin-left: -6px;
        border-width: 6px;
        border-style: solid;
        border-color: #34495e transparent transparent transparent;
    }

    .sync-info-mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        background: rgba(0, 0, 0, 0.2);
        padding: 8px;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* --- Header & Layout Utilities --- */
.header-top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
    gap: 2rem;
}

.header-bottom {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
}

.header-meta-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.api-usage-simple {
    opacity: 0.6;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

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

.action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sync-api-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 45px;
    /* Adjust to roughly match button height */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0 16px;
    min-width: 140px;
}

.sas-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    line-height: 1.1;
}

.sas-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sas-value {
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}

/* Prediction Synopsis Tooltip */
.predicted-winner {
    position: relative;
    z-index: 50;
    /* Higher than confidence-badge */
}

.synopsis-tip {
    min-width: 300px !important;
    max-width: 400px !important;
    text-align: left !important;
    padding: 16px !important;
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8) !important;
    z-index: 2100 !important;
    font-size: 0.88rem !important;
    line-height: 1.6 !important;
    pointer-events: auto;
}

.synopsis-tip .tip-header {
    font-weight: 800;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--primary-light);
    letter-spacing: 0.08em;
}

.synopsis-tip .tip-content {
    color: rgba(255, 255, 255, 0.95);
}

.action-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.header-stats-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

.stats-container {
    width: auto;
    margin: 0;
}

.stats-group {
    display: flex;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    font-weight: 600;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 800;
}

.stat-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
    height: 24px;
    align-self: center;
}

.stats-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.hit-rate-box {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: right;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.safety-badge {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.safety-label {
    color: #ef4444;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.safety-divider {
    width: 1px;
    height: 10px;
    background: rgba(239, 68, 68, 0.3);
}

.safety-usage {
    color: rgba(239, 68, 68, 0.9);
    font-size: 0.65rem;
}

.api-usage-simple {
    opacity: 0.4;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: right;
    width: 100%;
}

/* Visibility Utilities */
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }

    .header-top,
    .header-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .mobile-last-sync {
        position: absolute;
        top: 0;
        right: 0;
        color: var(--text-dim);
        font-size: 0.7rem;
        font-weight: 600;
        opacity: 0.8;
    }

    header {
        margin-bottom: 0.5rem;
        gap: 0.5rem;
        padding-bottom: 0;
    }

    .logo-area {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }

    .mobile-league-selector {
        display: block !important;
        width: 100%;
        margin: 0 0 1rem 0;
    }

    .league-info-btn {
        justify-content: center;
        width: 100%;
        position: relative;
    }

    .league-info-btn svg {
        position: absolute;
        right: 1.25rem;
        pointer-events: none;
    }

    .league-info-btn>div {
        justify-content: center;
        width: 100%;
    }

    .header-actions {
        display: block !important;
        /* Single column for single button */
        width: 100%;
    }

    .action-buttons {
        display: flex !important;
        flex-direction: column;
        width: 100%;
    }

    .hide-mobile {
        display: none !important;
    }

    .full-width-mobile {
        width: 100% !important;
        justify-content: center;
        margin: 0;
    }

    .header-stats-group {
        width: 100%;
        align-items: center;
    }

    .stats-container {
        width: 100%;
    }

    .stats-group {
        width: 100%;
        justify-content: space-between;
    }

    .stats-meta {
        align-items: center;
    }

    .card {
        padding: 1.5rem !important;
        width: 100% !important;
        min-width: 0;
        /* CRITICAL for grid items to shrink */
    }

    .prediction-card {
        padding-top: 5rem !important;
        min-width: 0;
    }

    .grid,
    .prediction-grid {
        gap: 1.5rem !important;
        grid-template-columns: 1fr !important;
    }

    /* League Info Mobile Fixes */
    .standings table {
        min-width: 300px;
        font-size: 0.7rem;
    }

    .team-cell img {
        width: 20px;
        height: 20px;
    }

    th,
    td {
        padding: 0.85rem 0.5rem !important;
    }

    .team-cell {
        gap: 0.4rem !important;
    }

    /* Result/Fixture Matchup Mobile Layout */
    .matchup {
        gap: 0.4rem !important;
    }

    .matchup .team {
        flex-direction: column !important;
        gap: 4px !important;
        text-align: center !important;
        justify-content: center !important;
        font-size: 0.75rem !important;
        max-width: 80px;
        /* Constrain width */
    }

    .matchup .team span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
    }

    .matchup .team.home,
    .matchup .team.away {
        text-align: center !important;
        justify-content: center !important;
    }

    .matchup .score,
    .matchup .vs {
        min-width: 45px !important;
        padding: 4px 6px !important;
        font-size: 0.8rem !important;
    }

    /* Further narrow point/form columns */
    .pts {
        font-weight: 800;
        width: 30px;
    }

    /* Tighter Table Spacing */
    th,
    td {
        padding: 0.75rem 0.25rem !important;
    }

    .team-cell {
        font-size: 0.75rem;
        gap: 0.3rem !important;
    }

    /* Prevent form wrapping */
    .form-indicators {
        display: flex;
        flex-wrap: nowrap !important;
        gap: 1px;
    }

    .form {
        font-size: 0.5rem;
        padding: 1px 2px;
        min-width: 0;
        width: 12px;
        text-align: center;
        line-height: normal;
    }

    /* Gap between results and fixtures */
    /* Gap between results and fixtures */
    .side-panel {
        gap: 1.5rem !important;
    }

    /* Hide desktop filter text on mobile */
    .filters-desktop-only {
        display: none !important;
    }

    .mobile-filter-toggle {
        display: block !important;
        margin-top: 1.5rem;
    }

    /* Model Methodology Mobile */
    .model-methodology {
        padding: 2rem !important;
        text-align: center;
    }

    .model-methodology h3 {
        font-size: 1.5rem;
    }
}