:root {
    --bg-color: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --accent-red: #ef4444;
    /* Fire (90+) */
    --accent-orange: #f97316;
    /* High (75-89) */
    --accent-yellow: #eab308;
    /* Warm (60-74) */
    --accent-blue: #3b82f6;
    /* Cool (<60) */
    --accent-gray: #525252;
    /* Low */
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* Header */
.header {
    margin-bottom: 3rem;
    text-align: center;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-primary);
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(to right, #ffffff, #a3a3a3);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.brand-icon {
    color: var(--accent-orange);
    -webkit-text-fill-color: var(--accent-orange);
}

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

/* Controls */
.controls {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.date-selector {
    background: var(--card-bg);
    padding: 0.25rem;
    border-radius: 99px;
    border: 1px solid var(--card-border);
    display: inline-flex;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1.5rem;
    border-radius: 99px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.control-btn:hover {
    color: var(--text-primary);
}

.control-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.control-row-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 800px;
}

.search-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-wrapper iconify-icon.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-wrapper .clear-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.search-wrapper .clear-icon:hover {
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

#search-input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    /* Padding for both icons */
    border-radius: 99px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

#search-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

.clear-filters-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.clear-filters-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.filter-select {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 0.75rem 2rem 0.75rem 1rem;
    border-radius: 99px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3Cpath fill='%23a3a3a3' d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6l-6-6l1.41-1.41z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    min-width: 140px;
}

.filter-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* --- News Ticker --- */
.news-ticker {
    background: #000;
    border-bottom: 1px solid var(--card-border);
    height: 36px;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
    z-index: 100;
    display: flex;
    align-items: center;
}

.news-ticker.hidden {
    display: none;
}

.ticker-track {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 300s linear infinite;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 36px;
}

.ticker-track:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-block;
    margin-right: 3rem;
}

.ticker-item strong {
    color: var(--accent-primary);
    margin-right: 0.5rem;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Leaderboard Layout */
.hype-leaderboard-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.leaderboard-header {
    display: grid;
    grid-template-columns: 50px 90px 2fr 1.5fr 1fr;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--card-border);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.col-hype,
.col-info {
    text-align: center;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 50px 90px 2fr 1.5fr 1fr;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    transition: background 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    background: var(--bg-color);
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Rank Column */
.rank-badge {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

/* League Column */
.league-col {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    text-align: center;
    width: fit-content;
    white-space: nowrap;
}

/* Matchup Column */
.matchup-cell {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.team-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 80px;
}

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

.team-name-inline {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.vs-inline {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 700;
    opacity: 0.5;
}

/* Hype Column */
.hype-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding-right: 2rem;
}

.hype-score-lg {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    min-width: 70px;
    text-align: right;
}

.hype-bar-mini {
    flex: 1;
    height: 16px;
    background:
        repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.1),
            rgba(255, 255, 255, 0.1) 2px,
            transparent 2px,
            transparent 20px),
        rgba(255, 255, 255, 0.05);
    /* Gauge Track Color */
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hype-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Elastic bounce */
    background: linear-gradient(90deg, #10b981 0%, #eab308 50%, #f97316 75%, #ef4444 100%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Info Column */
.info-cell {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.game-time {
    color: var(--text-primary);
    font-weight: 600;
}

.game-tv {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
}

.game-odds-sm {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-gray);
    margin-top: 0.25rem;
}

.live-badge {
    background: var(--accent-red);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .leaderboard-header {
        display: none;
    }

    .leaderboard-row {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 1.25rem;
        padding: 1.5rem;
    }

    .rank-badge {
        position: absolute;
        top: 1rem;
        left: 1rem;
        font-size: 1rem;
    }

    .matchup-cell {
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .team-inline {
        flex-direction: column;
        gap: 0.25rem;
    }

    .team-name-inline {
        font-size: 0.9rem;
    }

    .team-logo-sm {
        width: 48px;
        height: 48px;
    }

    .hype-cell {
        padding: 0;
        justify-content: center;
    }

    .info-cell {
        align-items: center;
        text-align: center;
        border-top: 1px solid var(--card-border);
        padding-top: 1rem;
    }
}


/* Loading */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
    color: var(--text-secondary);
    min-height: 300px;
    background: var(--bg-color);
    /* Matches container bg */
}

.spinner {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

/* Hype Levels - Dynamic Fallback (JS handles specific gradients) */
.hype-bar-mini.hype-fire .hype-bar-fill {
    /* Fallback only */
}

.hype-score-lg {
    transition: color 0.3s ease;
}

/* Specific League Badges (Legacy overrides removed to allow gradients) */
/* Unified League Badges (Standardized Gradients) */

/* NFL: Deep Blue */
.league-col.league-badge-nfl {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    border: none;
}

/* NBA: Deep Red (Distinction from NFL Blue & NCAAB Orange) */
.league-col.league-badge-nba {
    background: linear-gradient(135deg, #991b1b 0%, #ef4444 100%);
    color: white;
    border: none;
}

/* NCAAF: Athletic Gold */
.league-col.league-badge-ncaaf {
    background: linear-gradient(135deg, #854d0e 0%, #eab308 100%);
    color: white;
    border: none;
}

/* NCAAB: Vibrant Orange */
.league-col.league-badge-ncaab {
    background: linear-gradient(135deg, #c2410c 0%, #f97316 100%);
    color: white;
    border: none;
}

/* NHL: Cool Slate */
.league-col.league-badge-nhl {
    background: linear-gradient(135deg, #334155 0%, #64748b 100%);
    color: white;
    border: none;
}

/* MLB: Navy */
.league-col.league-badge-mlb {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    color: white;
    border: none;
}





.hype-low .hype-score {
    color: var(--accent-gray);
}


/* MODAL STYLES */
.hidden {
    display: none !important;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: #111;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

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

.modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.modal-score {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 800;
}

.modal-matchup {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
}

.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
}

.breakdown-label {
    color: var(--text-primary);
}

.breakdown-pts {
    font-family: var(--font-mono);
    color: var(--accent-orange);
    /* Default points color */
    font-weight: 700;
}

.modal-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

.theme-fire {
    color: var(--accent-red);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.theme-high {
    color: var(--accent-orange);
}

.theme-med {
    color: var(--accent-blue);
}

.theme-low {
    color: var(--accent-gray);
}

/* Badges */
.rel-badge {
    animation: fadeIn 0.5s ease-out;
}

.modal-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-blue);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-top {
    color: #22d3ee;
    border-color: rgba(34, 211, 238, 0.2);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.1);
}

/* Animations */
.hype-fire {
    animation: pulseBorder 2s infinite;
}

.game-card {
    opacity: 0;
    animation: slideIn 0.5s ease-out forwards;
}

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

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

@keyframes pulseBorder {
    0% {
        border-color: rgba(239, 68, 68, 0.3);
        box-shadow: 0 0 0 rgba(239, 68, 68, 0);
    }

    50% {
        border-color: rgba(239, 68, 68, 0.8);
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
    }

    100% {
        border-color: rgba(239, 68, 68, 0.3);
        box-shadow: 0 0 0 rgba(239, 68, 68, 0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.live-badge {
    background: #e50914;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
    animation: pulse 2s infinite;
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
}

.odds-pill {
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 20px;
    font-family: monospace;
    font-size: 0.8rem;
    color: #e0e0e0;
    margin-top: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: inline-block;
    white-space: nowrap;
}

.live-score-pill {
    border-color: rgba(229, 9, 20, 0.4);
    background: rgba(229, 9, 20, 0.1);
    color: #fff;
    font-weight: 700;
}

.upset-badge {
    background: #f59e0b;
    color: #1a1a1a;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    border-radius: 4px;
    margin-left: 0.25rem;
    text-transform: uppercase;
    text-transform: uppercase;
    animation: pulse 2s infinite;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Skeleton Loading */
.skeleton-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 1rem 1.5rem;
    display: grid;
    grid-template-columns: 50px 90px 2fr 1.5fr 1fr;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.skeleton-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: shimmer 1.5s infinite;
}

.badges-container {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
    /* Ensure badges wrap within their own container if needed */
}

/* Base Badge Style - resetting margins since container handles gap */
.trending-news-badge,
.badge-gem,
.badge-fire,
.upset-badge {
    margin-left: 0 !important;
}

.trending-news-badge {
    background: #8b5cf6;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.2s, opacity 0.2s;
}

.trending-news-badge:hover {
    transform: scale(1.05);
    opacity: 0.9;
    cursor: pointer;
}



.badge-gem {
    background: #06b6d4;
    /* Cyan 500 */
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    border-radius: 4px;
    margin-left: 0.25rem;
    text-transform: uppercase;
    text-transform: uppercase;
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-fire {
    background: #ef4444;
    /* Red 500 */
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    border-radius: 4px;
    margin-left: 0.25rem;
    text-transform: uppercase;
    text-transform: uppercase;
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
}

.league-badge-ncaab {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
}

.league-badge-nba {
    background: linear-gradient(135deg, #1d428a 0%, #c8102e 100%);
    color: white;
}


.skeleton-text {
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    width: 60%;
    margin-bottom: 4px;
}

.skeleton-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

[title] {
    cursor: help;
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

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