:root {
    --bg-color: #0d1117;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #00ff88;
    --primary-dim: rgba(0, 255, 136, 0.2);
    --text-main: #ffffff;
    --text-muted: #8b949e;
    --font-family: 'Outfit', sans-serif;
    --card-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Gradient */
.bg-animated {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at 15% 50%, rgba(0, 255, 136, 0.08), transparent 50%),
                radial-gradient(circle at 85% 30%, rgba(0, 162, 255, 0.08), transparent 50%);
    z-index: -1;
    animation: bgPulse 15s infinite alternate linear;
}

@keyframes bgPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

header {
    text-align: center;
    padding: 2rem 2rem 1.5rem;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    position: relative;
}

.hamburger {
    position: fixed;
    left: 1.5rem;
    top: 1.75rem;
    background: rgba(13, 17, 23, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-main);
    padding: 8px 12px;
    z-index: 1000;
    transition: var(--transition);
    font-family: var(--font-family);
}

.hamburger:hover {
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-dim);
    color: var(--primary);
}

/* --- Sidebar --- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 150;
    pointer-events: none;
}

.sidebar-overlay:not(.hidden) {
    pointer-events: auto;
}

.sidebar-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: transparent;
    z-index: 200;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar:not(.hidden) {
    transform: translateX(0);
}

.sidebar ul {
    list-style: none;
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar li {
    opacity: 0;
    transform: translateX(-20px);
    animation: sidebarFadeIn 0.4s ease forwards;
}

.sidebar li:nth-child(1) { animation-delay: 0.05s; }
.sidebar li:nth-child(2) { animation-delay: 0.12s; }
.sidebar li:nth-child(3) { animation-delay: 0.19s; }
.sidebar li:nth-child(4) { animation-delay: 0.26s; }
.sidebar li:nth-child(5) { animation-delay: 0.33s; }

@keyframes sidebarFadeIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar a {
    display: block;
    padding: 0.85rem 1.2rem;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.3px;
    position: relative;
}

.sidebar a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 1.2rem;
    right: 1.2rem;
    height: 2px;
    background: transparent;
    border-radius: 2px;
    transition: var(--transition);
}

.sidebar a:hover,
.sidebar a:focus {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.4), 0 0 60px rgba(0, 255, 136, 0.15);
    transform: translateX(6px);
}

.sidebar a:hover::after,
.sidebar a:focus::after {
    background: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* when hidden, reset animations so they replay on next open */
.sidebar.hidden li {
    animation: none;
    opacity: 0;
    transform: translateX(-20px);
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, #fff, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

header p {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

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

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-outline:hover {
    background: var(--glass-bg);
    box-shadow: none;
}

main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    margin-bottom: 5rem;
}

section h2 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20%;
    width: 60%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

/* Upcoming Matches */
.upcoming-grid {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.upcoming-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(12px);
    transition: var(--transition);
    cursor: pointer;
    min-width: 180px;
}

.upcoming-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.2);
}

.upcoming-flags {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.upcoming-flags .flag-icon {
    width: 28px;
    margin: 0;
}

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

/* Group Stage Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.group-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 1rem;
    backdrop-filter: blur(12px);
    transition: var(--transition);
}

.group-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 255, 136, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.group-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 800;
    color: var(--primary);
}

.match-row {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.match-time-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.2rem;
}

.ko-time {
    margin-bottom: 0.35rem;
    margin-top: 0;
}


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

.match-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.team {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0;
}

.team .flag-icon {
    flex-shrink: 0;
}

.team.right {
    justify-content: flex-end;
}

.team .team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.team.right {
    text-align: right;
}

.team.winner .team-name,
.ko-team-row.winner .ko-team {
    color: var(--primary);
}

.team.loser .team-name,
.ko-team-row.loser .ko-team {
    color: #e06666;
}

.team.draw .team-name,
.ko-team-row.draw .ko-team {
    color: #c9a800;
}

.team.winner,
.ko-team-row.winner,
.team.loser,
.ko-team-row.loser,
.team.draw,
.ko-team-row.draw {
    position: relative;
}

.live-match .team.winner::after,
.completed-match .team.winner::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: -10px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.55), transparent);
    pointer-events: none;
}

.live-match .team.loser::after,
.completed-match .team.loser::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: -10px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(224, 102, 102, 0.4), transparent);
    pointer-events: none;
}

.live-match .team.draw::after,
.completed-match .team.draw::after {
    content: '';
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: -10px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 0, 0.4), transparent);
    pointer-events: none;
}

.completed-match .match-time-label,
.completed-match .match-details {
    opacity: 0.9;
}

.match-details {
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    opacity: 0;
    transition: max-height 0.25s ease, margin-top 0.25s ease, opacity 0.25s ease;
}

.hover-target:hover .match-details,
.hover-target:focus-within .match-details {
    max-height: 8rem;
    margin-top: 0.35rem;
    opacity: 1;
}

.score-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 1rem;
}

.score-input {
    width: 26px;
    height: 26px;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 4px;
    font-family: var(--font-family);
    font-weight: 800;
    font-size: 0.9rem;
    transition: var(--transition);
}

.score-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-dim);
}

.score-input[readonly] {
    cursor: default;
}
.score-input[readonly]:focus {
    border-color: var(--glass-border);
    box-shadow: none;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.score-input {
  -moz-appearance: textfield;
}

.score-input.predicted {
    color: #ffc107;
}

.penalties-input.predicted {
    color: #ffc107;
}

.predicted-score-diff {
    color: #999;
    font-weight: 600;
    font-size: 0.75rem;
    margin-left: 0.25rem;
    white-space: nowrap;
}

.ko-team-row .predicted-score-diff {
    font-size: 0.65rem;
}

/* Outside-the-box scores in predict mode: predicted (gray) or original (white) */
.side-score {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
    min-width: 1.1em;
    text-align: center;
}
.side-score.predicted-side {
    color: #999;
}
.side-score.original-side {
    color: #fff;
}
.ko-team-row .side-score {
    font-size: 0.7rem;
    margin-left: 0.25rem;
}

.flag-icon {
    width: 18px;
    height: auto;
    border-radius: 2px;
    vertical-align: middle;
}

.team .flag-icon {
    margin-right: 6px;
}

.team.right .flag-icon {
    margin-right: 0;
    margin-left: 6px;
}

.ko-team .flag-icon {
    margin-right: 4px;
}

/* Highlight Animation */
@keyframes highlightPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); border-color: var(--primary); }
    70% { box-shadow: 0 0 0 15px rgba(0, 255, 136, 0); border-color: var(--primary); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); border-color: var(--glass-border); }
}

.highlight-match {
    animation: highlightPulse 1.5s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    background: rgba(0, 255, 136, 0.1) !important;
    border-radius: 8px;
}

/* Bracket Stage Layout */
.bracket-wrapper {
    overflow-x: auto;
    padding: 2rem 0;
}

.bracket {
    display: flex;
    margin: 0 auto;
    width: 100%;
    gap: 1.25rem;
    padding: 0 1rem;
}

.bracket-column {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.col-center {
    justify-content: center;
    align-items: center;
    flex: 1.4;
    padding: 0 0.75rem;
}

.knockout-match {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.45rem;
    min-width: 0;
    position: relative;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    cursor: pointer;
    z-index: 2;
}

/* Connecting Lines Layout */
.match-pair {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    position: relative;
    padding: 0.5rem 0;
}

/* Left Bracket Connections */
.left-col .match-pair::after {
    content: '';
    position: absolute;
    right: -0.375rem;
    top: 25%;
    height: 50%;
    width: 0.375rem;
    border: 2px solid var(--glass-border);
    border-left: none;
    z-index: -1;
    border-radius: 0 3px 3px 0;
}
.left-col .match-pair::before {
    content: '';
    position: absolute;
    right: -0.75rem;
    top: 50%;
    width: 0.375rem;
    border-top: 2px solid var(--glass-border);
    z-index: -1;
}

/* Right Bracket Connections */
.right-col .match-pair::after {
    content: '';
    position: absolute;
    left: -0.375rem;
    top: 25%;
    height: 50%;
    width: 0.375rem;
    border: 2px solid var(--glass-border);
    border-right: none;
    z-index: -1;
    border-radius: 3px 0 0 3px;
}
.right-col .match-pair::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    width: 0.375rem;
    border-top: 2px solid var(--glass-border);
    z-index: -1;
}

/* Single Match */
.match-single {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    position: relative;
}
.left-col .match-single::after {
    content: '';
    position: absolute;
    right: -0.75rem;
    top: 50%;
    width: 0.75rem;
    border-top: 2px solid var(--glass-border);
    z-index: -1;
}
.right-col .match-single::after {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    width: 0.75rem;
    border-top: 2px solid var(--glass-border);
    z-index: -1;
}

.knockout-match:hover {
    border-color: var(--primary);
    transform: scale(1.01);
}

.ko-team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-bottom: 0.2rem;
}

.ko-team-row:last-child {
    margin-bottom: 0;
}

.ko-team {
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.ko-team-row.winner .score-input {
    border-color: rgba(0, 255, 136, 0.6);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.12);
}

.ko-score {
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.final-match {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-dim);
}

.final-match:hover {
    transform: scale(1.02);
}

.final-label {
    text-align: center;
    color: var(--primary);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
    letter-spacing: 1.5px;
}

.penalties-input {
    width: 100%;
    margin-top: 0.3rem;
    background: transparent;
    border: none;
    border-top: 1px dashed var(--glass-border);
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.6rem;
    text-align: center;
    padding-top: 0.2rem;
}
.penalties-input:focus {
    outline: none;
    color: var(--text-main);
}

/* Lines connecting brackets (simplified via borders) */
.connect-right { position: relative; }
.connect-left { position: relative; }

footer {
    text-align: center;
    padding: 3rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
}
footer a {
    color: var(--primary);
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}

/* Standings */
.standings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.standings-table th, .standings-table td {
    padding: 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}

.standings-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
}

.standings-table td.team-cell {
    text-align: left;
    font-weight: 600;
}

.standings-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

.standings-table tr.standing-top .team-cell {
    color: #2e7d32;
}

.standings-table tr.standing-second .team-cell {
    color: #5b8dd9;
}

.standings-table tr.standing-third .team-cell {
    color: #e8923a;
}

.standings-table tr.standing-last .team-cell {
    color: #c62828;
}

/* Update Button Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.updating {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}
.updating::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 1rem; height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid #000;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

/* Live Match Styling */
.live-match {
    border-color: #ff3333 !important;
    background: rgba(255, 51, 51, 0.05) !important;
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.2);
}

.completed-match {
}

.live-badge {
    position: absolute;
    top: -8px;
    right: 10px;
    background: #ff3333;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    pointer-events: none;
    letter-spacing: 1px;
}

.pulsing-dot {
    width: 6px;
    height: 6px;
    background-color: #fff;
    border-radius: 50%;
    animation: livePulse 1s infinite;
}

@keyframes livePulse {
    0% { transform: scale(0.8); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.4; }
    100% { transform: scale(0.8); opacity: 1; }
}

.live-watch-btn {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    background: #ff3333;
    padding: 0.15rem 0.7rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
    margin: 0.3rem auto 0;
    width: fit-content;
    letter-spacing: 0.5px;
}

.live-watch-btn:hover {
    background: #cc0000;
}

.match-row .live-watch-btn,
.knockout-match .live-watch-btn {
    display: block;
    text-align: center;
}

.upcoming-card .live-watch-btn {
    margin-top: 0.4rem;
}

@media (max-width: 1024px) {
    .bracket {
        gap: 0.5rem;
        padding: 0 0.5rem;
    }
    .bracket-column {
        gap: 0.4rem;
    }
    .knockout-match {
        padding: 0.35rem;
        border-radius: 6px;
    }
    .match-pair {
        padding: 0.35rem 0;
    }
    .left-col .match-pair::after {
        right: -0.25rem;
        width: 0.25rem;
    }
    .left-col .match-pair::before {
        right: -0.5rem;
        width: 0.25rem;
    }
    .right-col .match-pair::after {
        left: -0.25rem;
        width: 0.25rem;
    }
    .right-col .match-pair::before {
        left: -0.5rem;
        width: 0.25rem;
    }
    .left-col .match-single::after,
    .right-col .match-single::after {
        width: 0.5rem;
    }
    .left-col .match-single::after {
        right: -0.5rem;
    }
    .right-col .match-single::after {
        left: -0.5rem;
    }
    .flag-icon {
        width: 13px;
    }
    .ko-team .flag-icon {
        margin-right: 2px;
    }
    .ko-team {
        font-size: 0.65rem;
    }
    .ko-score {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }
    .ko-time {
        font-size: 0.55rem;
        margin-bottom: 0.15rem;
    }
    .final-label {
        font-size: 0.6rem;
        margin-bottom: 0.2rem;
        letter-spacing: 1px;
    }
    .penalties-input {
        font-size: 0.55rem;
        margin-top: 0.2rem;
        padding-top: 0.15rem;
    }
    .live-watch-btn {
        font-size: 0.55rem;
        padding: 0.1rem 0.5rem;
        margin-top: 0.15rem;
    }
    .live-badge {
        font-size: 0.5rem;
        padding: 0.05rem 0.3rem;
        top: -8px;
        right: 4px;
    }
}

@media (max-width: 768px) {
    .bracket {
        width: max-content;
        gap: 0.4rem;
        padding: 0 0.5rem;
    }
    .bracket-column {
        gap: 0.35rem;
    }
    .knockout-match {
        padding: 0.3rem;
        border-radius: 6px;
    }
    .match-pair {
        padding: 0.3rem 0;
    }
    .left-col .match-pair::after {
        right: -0.2rem;
        width: 0.2rem;
    }
    .left-col .match-pair::before {
        right: -0.4rem;
        width: 0.2rem;
    }
    .right-col .match-pair::after {
        left: -0.2rem;
        width: 0.2rem;
    }
    .right-col .match-pair::before {
        left: -0.4rem;
        width: 0.2rem;
    }
    .left-col .match-single::after,
    .right-col .match-single::after {
        width: 0.4rem;
    }
    .left-col .match-single::after {
        right: -0.4rem;
    }
    .right-col .match-single::after {
        left: -0.4rem;
    }
    .flag-icon {
        width: 12px;
    }
    .ko-team {
        font-size: 0.6rem;
    }
    .ko-score {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }
    .ko-team-row {
        gap: 3px;
        margin-bottom: 0.15rem;
    }
    .ko-time {
        font-size: 0.5rem;
        margin-bottom: 0.12rem;
    }
    .final-label {
        font-size: 0.55rem;
        margin-bottom: 0.2rem;
        letter-spacing: 0.5px;
    }
    .penalties-input {
        font-size: 0.5rem;
        margin-top: 0.15rem;
        padding-top: 0.1rem;
    }
    .live-watch-btn {
        font-size: 0.5rem;
        padding: 0.05rem 0.4rem;
        margin-top: 0.1rem;
    }
    .live-badge {
        font-size: 0.45rem;
        padding: 0.05rem 0.25rem;
        top: -6px;
        right: 3px;
    }
    .bracket-wrapper {
        scroll-snap-type: x mandatory;
        padding: 0.75rem 0;
    }
    .bracket-column:nth-child(3n+1) {
        scroll-snap-align: start;
    }
}

/* ============================
   FILTER BAR
   ============================ */
#filter-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 17, 23, 0.92);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    padding: 0.75rem 2rem;
}

#filter-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    border-radius: 2px;
    pointer-events: none;
}

.filter-bar-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-team-wrap {
    position: relative;
    flex: 0 1 200px;
    min-width: 160px;
}

#filter-team,
.filter-select,
input[type="date"] {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    outline: none;
    height: 36px;
}

#filter-team {
    width: 100%;
}

.filter-select {
    min-width: 130px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%238b949e%22%20d%3D%22M6%208L1%203h10z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 1.8rem;
}

input[type="date"] {
    min-width: 140px;
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

.filter-date-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
}

.filter-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    font-weight: 600;
}

#filter-team:focus,
.filter-select:focus,
input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-dim);
}

#filter-team::placeholder {
    color: var(--text-muted);
}

.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: rgba(13, 17, 23, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    z-index: 110;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.suggestions-dropdown.hidden {
    display: none;
}

.suggestion-item {
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
    background: rgba(0, 255, 136, 0.12);
    color: var(--primary);
}

.suggestion-item .flag-icon {
    width: 18px;
}

.suggestion-empty {
    padding: 0.6rem 0.8rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    font-style: italic;
}

.status-chips {
    display: flex;
    gap: 0.3rem;
}

.chip {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    height: 36px;
    display: inline-flex;
    align-items: center;
}

.chip:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.chip.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-dim);
}

.filter-clear-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    height: 36px;
}

.filter-clear-btn:hover {
    border-color: #ff3333;
    color: #ff3333;
}

.filter-status {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    padding: 0.4rem;
    background: rgba(0, 255, 136, 0.06);
    border-radius: 6px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

.filter-status.hidden {
    display: none;
}

.filter-status strong {
    color: var(--primary);
}

/* ============================
   ENHANCED HOVER DETAILS
   ============================ */
.match-details {
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    opacity: 0;
    transition: max-height 0.3s ease, margin-top 0.25s ease, opacity 0.25s ease;
}

.hover-target:hover .match-details,
.hover-target:focus-within .match-details,
.hover-target.match-details-open .match-details {
    opacity: 1;
    margin-top: 0.35rem;
}

.match-stadium {
    color: var(--text-muted);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-goals {
    margin-top: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.goal-entry {
    font-size: 0.7rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.goal-entry .flag-icon {
    width: 14px;
    height: auto;
    flex-shrink: 0;
}

.goal-entry .goal-og {
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ff6666, #cc0000 80%);
    vertical-align: middle;
    line-height: 1;
    flex-shrink: 0;
}

.goal-scorer {
    font-weight: 500;
}

.match-info-btn {
    margin-top: 0.5rem;
    background: var(--primary);
    color: #000;
    border: none;
    padding: 0.3rem 0.7rem;
    border-radius: 14px;
    font-family: var(--font-family);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.3px;
}

.match-info-btn:hover {
    background: #fff;
    box-shadow: 0 0 12px var(--primary-dim);
    transform: translateY(-1px);
}

.ko-info-btn {
    margin-top: 0.4rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.65rem;
    border-radius: 12px;
}

.ko-goals {
    margin-top: 0.25rem;
}

.ko-goals .goal-entry {
    font-size: 0.62rem;
}

/* ============================
   MATCH STATS OVERLAY
   ============================ */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay.hidden {
    display: none;
}

.overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: overlayFadeIn 0.2s ease;
}

.overlay-content {
    position: relative;
    max-width: 700px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(13, 17, 23, 0.97);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    animation: overlaySlideIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.overlay-content::-webkit-scrollbar {
    width: 8px;
}

.overlay-content::-webkit-scrollbar-track {
    background: transparent;
}

.overlay-content::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.overlay-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dim);
}

.overlay-close {
    position: absolute;
    top: 0.8rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 5;
}

.overlay-close:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes overlaySlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

body.overlay-open {
    overflow: hidden;
}

/* Overlay internal sections */
.ov-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.ov-team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.ov-team-flag {
    width: 48px;
    height: auto;
    border-radius: 4px;
}

.ov-team-name {
    font-size: 1rem;
    font-weight: 700;
}

.ov-score {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    flex-shrink: 0;
    letter-spacing: 2px;
    min-width: 80px;
    text-align: center;
}

.ov-score-pens {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.2rem;
}

.ov-meta {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.ov-section {
    margin-bottom: 1.5rem;
}

.ov-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ov-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

/* Goals list */
.ov-goals-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ov-goal-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-size: 0.85rem;
}

.ov-goal-minute {
    font-weight: 800;
    color: var(--primary);
    min-width: 36px;
}

.ov-goal-player {
    flex: 1;
    font-weight: 600;
}

.ov-goal-type {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 6px;
    border-radius: 4px;
}

/* Cards list */
.ov-card-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.ov-card-icon {
    width: 14px;
    height: 18px;
    border-radius: 2px;
    flex-shrink: 0;
}

.ov-card-icon.yellow {
    background: #f5d142;
    box-shadow: 0 0 6px rgba(245, 209, 66, 0.5);
}

.ov-card-icon.red {
    background: #ff3333;
    box-shadow: 0 0 6px rgba(255, 51, 51, 0.5);
}

.ov-card-minute {
    font-weight: 800;
    color: var(--text-muted);
    min-width: 36px;
}

.ov-card-player {
    flex: 1;
    font-weight: 600;
}

/* Stats bars */
.ov-stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.ov-stat-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
}

.ov-stat-value {
    min-width: 36px;
    text-align: center;
    font-weight: 700;
}

.ov-stat-value.left {
    color: var(--primary);
}

.ov-stat-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}

.ov-stat-bar {
    height: 100%;
    transition: width 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ov-stat-bar.left {
    background: linear-gradient(90deg, var(--primary), var(--primary-dim));
}

.ov-stat-bar.right {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.2));
}

.ov-stat-label {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}

/* Lineups - Formation Pitch */
.ov-pitch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ov-pitch-team-label {
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}

.ov-pitch-team-home {
    color: var(--primary);
}

.ov-pitch-team-away {
    color: #90caf9;
    margin-top: 0.3rem;
}

.ov-pitch-team-label .flag-icon {
    width: 18px;
}

.ov-pitch-formation {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    padding: 1px 5px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}

.ov-pitch {
    width: 100%;
    max-width: 360px;
    aspect-ratio: 3 / 5;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a6e3a 0%, #228848 30%, #1f7a3d 60%, #1a6e3a 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4), inset 0 0 30px rgba(0,0,0,0.15);
}

.ov-pitch-field {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5% 5% 3%;
}

/* Pitch markings */
.ov-pitch-markings {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
}

.ov-pitch-outline {
    position: absolute;
    top: 3%; left: 4%;
    width: 92%; height: 94%;
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 3px;
}

.ov-pitch-halfway {
    position: absolute;
    top: 50%;
    left: 4%;
    width: 92%;
    height: 0;
    border-top: 1.5px solid rgba(255,255,255,0.35);
}

.ov-pitch-center-circle {
    position: absolute;
    top: 50%; left: 50%;
    width: 18%; height: 0;
    padding-bottom: 18%;
    transform: translate(-50%, -50%);
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 50%;
}

.ov-pitch-penalty-box {
    position: absolute;
    left: 18%;
    width: 64%;
    height: 20%;
    border: 1.5px solid rgba(255,255,255,0.28);
}

.ov-pitch-penalty-top {
    top: 3%;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
}

.ov-pitch-penalty-bot {
    bottom: 3%;
    border-top: none;
    border-radius: 0 0 3px 3px;
}

/* Player rows on the pitch */
.ov-pitch-rows {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.ov-pitch-half {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    padding: 2% 0;
}

.ov-pitch-half-home {
    /* top half: players go top→center */
}

.ov-pitch-half-away {
    /* bottom half: players go center→bottom */
}

.ov-pitch-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
}

.ov-pitch-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    cursor: default;
    transition: transform 0.2s;
}

.ov-pitch-player:hover {
    transform: scale(1.12);
    z-index: 10;
}

.ov-pitch-player-away .ov-pitch-num {
    border-color: rgba(144, 202, 249, 0.7);
}

.ov-pitch-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.ov-pitch-num {
    position: relative;
}

/* Event icon cluster anchored to the player's number badge */
.ov-pitch-icons {
    position: absolute;
    top: -7px;
    right: -9px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1px;
    line-height: 1;
    pointer-events: none;
}

.ov-ic {
    font-size: 0.55rem;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.6));
}

.ov-ic-goal { font-size: 0.6rem; }
/* Own goal: normal ⚽ with a red ring so it reads as an own goal */
.ov-ic-og {
    display: inline-block;
    border: 1.5px solid #e11d1d;
    border-radius: 50%;
    padding: 1px;
    line-height: 1;
    box-sizing: content-box;
}
.ov-ic-assist { font-size: 0.55rem; }

.ov-ic-card {
    display: inline-block;
    width: 6px;
    height: 8px;
    border-radius: 1px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.5);
}
.ov-ic-yellow { background: #f6c915; }
.ov-ic-red { background: #e23b3b; }

.ov-ic-subout { color: #e23b3b; font-weight: 900; font-size: 0.6rem; }
.ov-ic-subin { color: #36c267; font-weight: 900; font-size: 0.7rem; }

.ov-pitch-sub-icons {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}
.ov-pitch-sub-icons .ov-pitch-icons {
    position: static;
    display: inline-flex;
}

.ov-pitch-name {
    font-size: 0.5rem;
    color: rgba(255,255,255,0.95);
    font-weight: 600;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

/* Substitutes grid */
.ov-subs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.8rem;
}

.ov-subs-team-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.3rem;
}

.ov-subs-team-header .flag-icon {
    width: 16px;
}

.ov-subs-list:empty {
    display: none;
}

.ov-pitch-sub {
    padding: 3px 0;
    font-size: 0.72rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ov-pitch-sub-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    line-height: 1;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.ov-pitch-sub-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ov-pitch-sub-pos {
    color: var(--text-muted);
    font-size: 0.62rem;
    margin-left: 4px;
    flex-shrink: 0;
}

.ov-pitch-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

.ov-loading {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

.ov-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.ov-headline {
    background: rgba(0, 255, 136, 0.05);
    border-left: 3px solid var(--primary);
    padding: 0.7rem 0.9rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-main);
    margin-bottom: 1.2rem;
}

.ov-headline strong {
    color: var(--primary);
    font-style: normal;
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
}

/* No matches message */
.no-matches-msg {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 1rem;
    background: var(--glass-bg);
    border: 1px dashed var(--glass-border);
    border-radius: var(--card-radius);
    grid-column: 1 / -1;
}

/* Hidden elements from filter */
.filter-hidden {
    display: none !important;
}

/* Responsive filter bar */
@media (max-width: 1024px) {
    .filter-bar-inner {
        gap: 0.5rem;
    }
    .filter-team-wrap {
        flex: 1 1 160px;
    }
    .filter-select,
    input[type="date"] {
        min-width: 120px;
        font-size: 0.8rem;
    }
}

.hidden { display: none !important; }

/* Predict Mode Bar */
#predict-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.6rem 2rem;
    background: rgba(13, 17, 23, 0.85);
    border-bottom: 1px solid var(--glass-border);
}

#predict-bar .btn-outline {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    height: 34px;
}

#predict-bar .btn-outline:hover {
    border-color: var(--primary);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

#predict-bar .btn-outline.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-dim);
}

.predict-clear-link {
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    opacity: 0.6;
    transition: var(--transition);
    white-space: nowrap;
}
.predict-clear-link:hover {
    opacity: 1;
    color: var(--primary);
}

@media (max-width: 768px) {
    #predict-bar {
        padding: 0.4rem 1rem;
        gap: 0.4rem;
    }
    #predict-bar .btn-outline {
        font-size: 0.75rem;
        padding: 0.25rem 0.8rem;
        height: 30px;
    }
}

.predict-warn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff8800;
    color: #000;
    font-size: 0.6rem;
    font-weight: 900;
    line-height: 1;
    margin-left: 3px;
    cursor: help;
    vertical-align: middle;
}

@media (max-width: 768px) {
    #filter-bar {
        padding: 0.6rem 0.8rem;
    }
    .filter-bar-inner {
        gap: 0.4rem;
    }
    .filter-team-wrap {
        flex: 1 1 100%;
    }
    .filter-date-wrap,
    .filter-team-wrap,
    .status-chips {
        flex: 1 1 calc(50% - 0.4rem);
    }
    .filter-select {
        flex: 1 1 calc(50% - 0.4rem);
        min-width: 0;
    }
    .status-chips {
        justify-content: center;
    }
    .chip {
        flex: 1;
        justify-content: center;
    }
    .filter-clear-btn {
        flex: 1 1 100%;
    }
    .ov-pitch {
        max-width: 100%;
    }
    .ov-subs-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    #filter-bar {
        position: static;
    }
    #filter-bar::before {
        display: none;
    }
    .overlay-content {
        padding: 1.2rem;
        width: 96%;
    }
    .ov-team-flag {
        width: 32px;
    }
    .ov-team-name {
        font-size: 0.85rem;
    }
    .ov-score {
        font-size: 1.8rem;
    }
}

/* ============================= */
/* CLOUD PREDICTIONS             */
/* ============================= */
.predict-identity {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    margin: 0 0.2rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--glass-bg);
    white-space: nowrap;
}
#predict-publish.published-flash {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 12px var(--primary-dim);
}

/* Leaderboard */
#leaderboard-section { margin-top: 2rem; }
.leaderboard {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 1.2rem;
    overflow-x: auto;
}
.lb-legend {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 1rem;
}
.lb-legend b { color: var(--primary); }
.lb-empty { color: var(--text-muted); text-align: center; padding: 1rem; }
.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.lb-table th, .lb-table td {
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}
.lb-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
.lb-table tbody tr:hover { background: var(--glass-bg); }
.lb-table td:nth-child(3) { color: var(--primary); font-weight: 700; }
.lb-table tr.lb-me {
    background: var(--primary-dim);
}
.lb-table tr.lb-me td { color: var(--text-main); font-weight: 600; }

/* Modal (nickname + preds) */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal.hidden { display: none; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.modal-card {
    position: relative;
    z-index: 1;
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 1.8rem;
    width: min(90vw, 420px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-card h3 { margin: 0 0 0.4rem; }
.modal-sub { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 1.2rem; }
.modal-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    font-family: var(--font-family);
    font-size: 1rem;
    margin-bottom: 0.8rem;
}
.modal-input:focus { outline: none; border-color: var(--primary); }
.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: 0.5rem;
}
.auth-switch-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    text-align: left;
}
.auth-switch-link:hover { color: var(--primary); }
.modal-error {
    color: #ff5c5c;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}
.modal-error.hidden { display: none; }
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 0.5rem;
}
.btn-solid {
    background: var(--primary);
    color: #04110a;
    border: none;
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    font-family: var(--font-family);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.btn-solid:hover { box-shadow: 0 5px 15px var(--primary-dim); }
.modal-card .overlay-close {
    position: absolute;
    top: 0.8rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}
.modal-card .overlay-close:hover { color: var(--text-main); }

/* Per-match prediction reveal: button in hover card -> modal */
.preds-open-btn {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.7rem;
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-dim);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
}
.preds-open-btn:hover { background: var(--primary); color: #04110a; }

.preds-actual { color: var(--text-muted); margin: 0 0 1rem; }
.preds-actual b { color: var(--primary); }
.preds-dist { margin-bottom: 1.2rem; }
.preds-bar-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}
.preds-score { width: 3rem; font-weight: 600; }
.preds-bar {
    flex: 1;
    height: 0.7rem;
    background: var(--glass-bg);
    border-radius: 999px;
    overflow: hidden;
}
.preds-bar-fill {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
}
.preds-count { width: 1.5rem; text-align: right; color: var(--text-muted); }
.preds-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.preds-table th, .preds-table td {
    padding: 0.5rem 0.7rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}
.preds-table th {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.preds-table td:last-child { color: var(--primary); font-weight: 700; }
.preds-pens { color: var(--text-muted); font-size: 0.8rem; }
#preds-modal .modal-card { max-height: 85vh; overflow-y: auto; }
