:root {
    --bg-color: #0b0c10;
    --card-bg: rgba(31, 33, 42, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #45f3ff;
    --primary-glow: rgba(69, 243, 255, 0.4);
    --secondary: #9c27b0;
    --text-main: #ffffff;
    --text-muted: #8b92a5;
    --accent-win: #4caf50;
    --accent-live: #f44336;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background animated globs */
.background-glob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
    animation: float 20s infinite alternate;
}
.glob-1 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    top: -100px;
    left: -100px;
}
.glob-2 {
    width: 500px;
    height: 500px;
    background: #1a237e;
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100vh;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.brand h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    font-size: 0.8rem;
    background: var(--primary);
    color: #000;
    padding: 2px 8px;
    border-radius: 12px;
    vertical-align: top;
    margin-left: 5px;
}

.brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.fetch-action {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fetch-action input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    width: 80px;
    text-align: center;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.fetch-action input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), #00bcd4);
    color: #000;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--primary-glow);
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    gap: 2rem;
    flex: 1;
    min-height: 0; /* needed for nested scrolling */
}

.runs-panel {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
}

.runs-panel h2 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.runs-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.5rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 10px;
}

/* Run Item Card */
.run-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    padding: 1.2rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.run-card:hover, .run-card.active {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

.run-card.active {
    box-shadow: inset 2px 0 0 var(--primary);
}

.run-date {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.run-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.badge-matches {
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* Details Panel */
.details-panel {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.empty-state {
    margin: auto;
    text-align: center;
    color: var(--text-muted);
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Match Tables */
.tournament-section {
    margin-bottom: 2rem;
}

.tournament-header {
    background: linear-gradient(90deg, rgba(255,255,255,0.05), transparent);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.match-row {
    display: grid;
    grid-template-columns: 80px 1fr 60px 1fr 100px;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
    transition: background 0.2s;
}

.match-row:hover {
    background: rgba(255,255,255,0.03);
}

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

.m-time { color: var(--text-muted); font-size: 0.9rem; }
.m-team.home { text-align: right; }
.m-team.away { text-align: left; }
.m-score {
    text-align: center;
    font-weight: 700;
    font-size: 1.2rem;
    background: rgba(0,0,0,0.3);
    padding: 0.4rem;
    border-radius: 8px;
    letter-spacing: 2px;
}
.m-status {
    text-align: right;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.status-liv { color: var(--accent-live); }
.status-fin { color: var(--text-muted); }
.status-sch { color: var(--primary); }

/* Overlay Loading */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.overlay.hidden { display: none; }
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--card-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton-loader {
    height: 80px;
    border-radius: 16px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 400% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}
@keyframes skeleton {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
