:root {
    --bg-dark: #0a0e1a;
    --bg-card: #1a1f35;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #00fff2;
    --accent-glow: rgba(0, 255, 242, 0.3);
    --success-color: #10b981;
    --danger-color: #ef4444;
}

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

body {
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 100%);
    color: var(--text-primary);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
    border-bottom: 2px solid rgba(0, 255, 242, 0.2);
    padding-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    color: var(--accent-color);
    text-shadow: 0 0 20px var(--accent-glow);
    margin-bottom: 0.5rem;
}

header h1 i {
    margin-right: 1rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.tab {
    background: var(--bg-card);
    border: 2px solid transparent;
    color: var(--text-secondary);
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.tab:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
}

.tab i {
    margin-right: 0.5rem;
}

/* Sections */
.section {
    display: none;
}

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

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: var(--accent-color);
    font-size: 1.8rem;
}

.btn-refresh {
    background: var(--bg-card);
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.btn-refresh:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-refresh i {
    margin-right: 0.5rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--accent-color);
    font-size: 1.2rem;
    display: none;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.data-table thead {
    background: rgba(0, 255, 242, 0.1);
    border-bottom: 2px solid var(--accent-color);
}

.data-table th {
    padding: 1.2rem;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--accent-color);
    letter-spacing: 1px;
}

.data-table td {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

/* Zebra striping removed for cleaner look */
.data-table tbody tr {
    background: rgba(255, 255, 255, 0.02);
}

/* Hover effect managed by JavaScript */
.data-table tbody tr.game-row.hovered {
    background: rgba(0, 255, 242, 0.08) !important;
}

.game-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

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

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

.team-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.time-cell {
    vertical-align: middle;
    font-size: 0.9rem;
}

.teased {
    color: var(--accent-color);
    font-weight: 700;
}

.roi-cell {
    font-weight: 700;
    font-size: 1.05rem;
}

.roi-cell.positive {
    color: var(--success-color);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.roi-cell.negative {
    color: var(--danger-color);
}

.total-cell {
    font-weight: 600;
    vertical-align: middle;
}

/* Pick'em Edge Styles */
.pickem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pickem-controls {
    display: flex;
    gap: 10px;
}

#pool-selector {
    padding: 8px;
    border-radius: 4px;
    background: #333;
    color: #fff;
    border: 1px solid #555;
    font-size: 1em;
}

.edge-positive {
    background-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    font-weight: bold;
}

.edge-neutral {
    color: #ccc;
}

.edge-negative {
    color: #e74c3c;
}

/* Center numeric columns in Pickem Table */
.pickem-table th,
.pickem-table td {
    text-align: center;
}

/* Left-align text columns */
.pickem-table th:first-child,
.pickem-table td:first-child,
/* Time */
.pickem-table th:nth-child(2),
.pickem-table td:nth-child(2)

/* Matchup */
    {
    text-align: left;
}

/* Reusing global .roi-cell.positive/negative from Teaser styles */

.total-cell.low-total {
    color: var(--success-color);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    font-weight: 700;
}

.wong-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, var(--accent-color), var(--success-color));
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.4);
    margin-right: 0.4rem;
}

.div-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid #8b5cf6;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #a78bfa;
    letter-spacing: 0.5px;
}

.neutral-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: rgba(234, 179, 8, 0.2);
    border: 1px solid #eab308;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #eab308;
    margin-left: 0.5rem;
}

.wong-cell {
    text-align: left;
    vertical-align: middle;
}

.game-separator {
    height: 12px;
    background: transparent;
}

.game-separator td {
    padding: 0;
    border: none;
}

.game-row {
    transition: background-color 0.2s ease;
}

.ev-cell {
    font-weight: 700;
}

.ev-cell.positive {
    color: var(--success-color);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.survivor-table th {
    text-align: center;
}

.survivor-table th:first-child {
    text-align: left;
}

.survivor-table td {
    text-align: center;
}

.survivor-table .team-name {
    text-align: left;
}

.survivor-table .team-cell {
    justify-content: flex-start;
    padding-left: 1rem;
}

/* Sort icons */
.sort-icon {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.sortable-header:hover {
    color: var(--text-primary);
}

.sortable-header:hover .sort-icon {
    opacity: 1;
}

.sort-icon.active {
    opacity: 1;
    color: var(--accent-color);
}

.survivor-note {
    background: rgba(0, 255, 242, 0.1);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.survivor-note strong {
    color: var(--accent-color);
}

.survivor-note a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.survivor-note a:hover {
    text-decoration: underline;
}

.survivor-note i {
    color: var(--accent-color);
    margin-right: 0.5rem;
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
}

.error a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.error a:hover {
    text-decoration: underline;
}

.empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Enhanced Survivor Table Styling */
.future-val-cell {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent-color);
}

.elo-cell {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Future Value highlighting */
.high-future-val {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, transparent 100%) !important;
    border-left: 3px solid var(--success-color);
}

.medium-future-val {
    background: linear-gradient(90deg, rgba(0, 255, 242, 0.1) 0%, transparent 100%) !important;
    border-left: 3px solid var(--accent-color);
}

/* Contrarian pick highlighting */
.contrarian-pick {
    color: var(--accent-color);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 255, 242, 0.5);
}

.survivor-table .high-future-val .future-val-cell,
.survivor-table .medium-future-val .future-val-cell {
    text-shadow: 0 0 10px rgba(0, 255, 242, 0.5);
}

/* Table Wrapper for Mobile Scrolling */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .tabs {
        flex-direction: column;
    }

    /* Ensure tables don't break viewport */
    .data-table {
        font-size: 0.85rem;
        min-width: 800px;
        /* Maintain readable table width */
    }

    .data-table th,
    .data-table td {
        padding: 0.8rem;
        white-space: nowrap;
        /* Prevent text wrapping in cells */
    }

    /* Slightly smaller team logos on mobile */
    .team-logo {
        width: 20px;
        height: 20px;
    }
}

/* Filters */
.filters-container {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    user-select: none;
}

.filter-group label:hover {
    color: var(--text-primary);
}

.filter-group input[type="checkbox"] {
    accent-color: var(--accent-color);
    width: 16px;
    height: 16px;
}

/* ELO Source Badge */
.elo-source-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 10px;
    vertical-align: middle;
}

.elo-source-api {
    color: #4ade80;
    border: 1px solid #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.elo-source-fallback {
    color: #fbbf24;
    border: 1px solid #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

/* ROS SOS Styles */
.sos-easy {
    color: #4ade80;
    /* Green */
    font-weight: bold;
}

.sos-hard {
    color: #f87171;
    /* Red */
    font-weight: bold;
}

/* Future Power Styles */
.future-power-high {
    color: #4ade80;
    /* Green - Strong future outlook */
    font-weight: bold;
}

.future-power-low {
    color: #f87171;
    /* Red - Weak future outlook */
    font-weight: bold;
}

/* Star Rating Styles */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 1rem;
}

.star-rating i {
    color: #fbbf24;
    /* Gold */
}

.star-rating .star-value {
    margin-left: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.survivor-value-cell {
    font-weight: 600;
}

/* Survivor Value Color Coding */
.survivor-value-excellent {
    background: rgba(74, 222, 128, 0.1);
}

.survivor-value-good {
    background: rgba(132, 204, 22, 0.1);
}

.survivor-value-average {
    background: rgba(251, 191, 36, 0.1);
}

.survivor-value-poor {
    background: rgba(248, 113, 113, 0.1);
}

/* Contrarian Pick Highlighting */
.contrarian-pick {
    color: #14b8a6;
    /* Teal */
    font-weight: bold;
}

/* ELO Advantage Styles */
.elo-adv-high {
    color: #4ade80;
    /* Green - Big mismatch in your favor */
    font-weight: bold;
}

.elo-adv-low {
    color: #f87171;
    /* Red - You're the underdog */
    font-weight: bold;
}

/* Teaser Table Striping - Using JS-based class for reliability with rowspan */
.teasers-table tbody tr.striped-game,
.teasers-table tbody tr.striped-game td {
    background-color: rgba(255, 255, 255, 0.025);
    /* Reduced to 0.025 for very subtle effect */
    /* Apply to TD as well to override any defaults */
    background-clip: padding-box;
    /* Fix for Safari rendering artifacts */
}

/* Fix for Safari last-child background clipping */
.teasers-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.teasers-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.teasers-table tbody tr:hover,
.teasers-table tbody tr.hovered {
    background-color: rgba(255, 255, 255, 0.05);
}