@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-dark: #070a13;
    --bg-card: rgba(19, 26, 43, 0.75);
    --bg-card-hover: rgba(26, 36, 59, 0.85);
    --bg-input: #0f1523;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 255, 136, 0.3);

    --text-main: #f0f4f8;
    --text-muted: #8c9bae;
    --text-dark: #070a13;

    --accent-green: #00ff88;
    --accent-blue: #00c2ff;
    --accent-gold: #ffd700;
    --accent-red: #ff3860;
    --accent-purple: #9d4edd;

    --gradient-primary: linear-gradient(135deg, #00ff88 0%, #00c2ff 100%);
    --gradient-gold: linear-gradient(135deg, #ffd700 0%, #ff9e00 100%);
    --gradient-dark: linear-gradient(180deg, rgba(13, 19, 33, 0.9) 0%, rgba(7, 10, 19, 0.95) 100%);

    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 20px rgba(0, 255, 136, 0.25);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 🌞 LIGHT THEME (Minimalist & Clean) */
[data-theme="light"] {
    --bg-dark: #f4f7f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f4f8;
    --bg-input: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(0, 123, 255, 0.3);

    --text-main: #1a202c;
    --text-muted: #64748b;
    --text-dark: #ffffff;

    --accent-green: #007bff; /* Primary action color for light mode */
    --accent-blue: #0056b3;
    --accent-gold: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;

    --gradient-primary: linear-gradient(135deg, #007bff 0%, #00d2ff 100%);
    --gradient-dark: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(244, 247, 249, 0.98) 100%);
    
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 15px rgba(0, 123, 255, 0.2);
}

/* 🌊 OCEAN BLUE THEME (Champions League Vibes) */
[data-theme="ocean"] {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-input: #0f172a;
    --border-color: rgba(56, 189, 248, 0.15);
    --border-glow: rgba(56, 189, 248, 0.3);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;

    --accent-green: #38bdf8; /* Cyan */
    --accent-blue: #818cf8;
    --accent-gold: #fbbf24;
    --accent-red: #f43f5e;
    --accent-purple: #c084fc;

    --gradient-primary: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    --gradient-dark: linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.25);
}

/* 🔴 RUBY RED THEME (Aggressive & Bold) */
[data-theme="ruby"] {
    --bg-dark: #1a0505;
    --bg-card: #2d0a0a;
    --bg-card-hover: #401010;
    --bg-input: #1a0505;
    --border-color: rgba(255, 56, 96, 0.15);
    --border-glow: rgba(255, 56, 96, 0.3);

    --text-main: #fdf2f2;
    --text-muted: #fca5a5;
    --text-dark: #1a0505;

    --accent-green: #ff3860; /* Crimson Red */
    --accent-blue: #fca5a5;
    --accent-gold: #fbbf24;
    --accent-red: #ef4444;
    --accent-purple: #f472b6;

    --gradient-primary: linear-gradient(135deg, #ff3860 0%, #f43f5e 100%);
    --gradient-dark: linear-gradient(180deg, rgba(45, 10, 10, 0.9) 0%, rgba(26, 5, 5, 0.95) 100%);
    
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(255, 56, 96, 0.25);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(0, 255, 136, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(0, 194, 255, 0.06) 0%, transparent 40%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* App Layout */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-size: 20px;
    font-weight: 900;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-main);
    background: rgba(0, 255, 136, 0.08);
}

.nav-item.active {
    color: var(--accent-green);
    border-left: 3px solid var(--accent-green);
    font-weight: 600;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px 40px;
    max-width: calc(100vw - 260px);
}

/* Header & Topbar */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title h1 {
    font-size: 28px;
    color: var(--text-main);
}

.page-title p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* Buttons & Inputs */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-dark);
    box-shadow: 0 4px 14px rgba(0, 255, 136, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.35);
}

.btn-gold {
    background: var(--gradient-gold);
    color: var(--text-dark);
    box-shadow: 0 4px 14px rgba(255, 215, 0, 0.25);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.35);
}

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

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-icon:hover {
    background: var(--accent-green);
    color: var(--text-dark);
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue { background: rgba(0, 194, 255, 0.1); color: var(--accent-blue); }
.stat-icon.gold { background: rgba(255, 215, 0, 0.1); color: var(--accent-gold); }
.stat-icon.red { background: rgba(255, 56, 96, 0.1); color: var(--accent-red); }

.stat-details h3 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-details p {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    text-align: left;
    padding: 14px 16px;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    vertical-align: middle;
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.table tr.highlight-winner td {
    background: rgba(0, 255, 136, 0.04);
}

.table tr.highlight-runnerup td {
    background: rgba(0, 194, 255, 0.04);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-green { background: rgba(0, 255, 136, 0.15); color: var(--accent-green); border: 1px solid rgba(0, 255, 136, 0.3); }
.badge-blue { background: rgba(0, 194, 255, 0.15); color: var(--accent-blue); border: 1px solid rgba(0, 194, 255, 0.3); }
.badge-gold { background: rgba(255, 215, 0, 0.15); color: var(--accent-gold); border: 1px solid rgba(255, 215, 0, 0.3); }
.badge-red { background: rgba(255, 56, 96, 0.15); color: var(--accent-red); border: 1px solid rgba(255, 56, 96, 0.3); }
.badge-muted { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }

/* Team Emblem / Logo Pill */
.team-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.team-badge {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
    color: #000;
    text-shadow: 0 1px 2px rgba(255,255,255,0.2);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    flex-shrink: 0;
}

/* Tournament Grid / Cards */
.tournament-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.tournament-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.tournament-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-green);
    box-shadow: var(--shadow-glow);
}

.tourney-banner {
    height: 110px;
    background: var(--gradient-dark);
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-bottom: 1px solid var(--border-color);
}

.tourney-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: var(--gradient-primary);
    filter: blur(60px);
    opacity: 0.25;
}

.tourney-banner h3 {
    font-size: 20px;
    color: #fff;
    z-index: 1;
}

.tourney-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tourney-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.tourney-footer {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Match Schedule Card */
.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.match-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--bg-card-hover);
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex: 1;
}

.team-side {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 40%;
}

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

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

.score-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #070a13;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 800;
    min-width: 90px;
    justify-content: center;
}

.score-box.completed {
    border-color: var(--accent-green);
    color: var(--accent-green);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.15);
}

/* Tabs */
.tabs-nav {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 20px;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

/* Tournament Bracket Visualizer */
.bracket-container {
    display: flex;
    gap: 40px;
    overflow-x: auto;
    padding: 20px 0;
    min-height: 400px;
    align-items: center;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-width: 260px;
    gap: 30px;
}

.bracket-round-title {
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 16px;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.05em;
}

.bracket-match {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
}

.bracket-match::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 3px; height: 100%;
    background: var(--gradient-primary);
}

.bracket-team {
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
    font-weight: 600;
}

.bracket-team:last-child {
    border-bottom: none;
}

.bracket-team.winner {
    color: var(--accent-green);
    background: rgba(0, 255, 136, 0.05);
}

.bracket-score {
    font-weight: 800;
    background: #070a13;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Outfit', sans-serif;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(7, 10, 19, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #0f1523;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 20px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.15);
}

select.form-control {
    cursor: pointer;
}

/* Team Selection Checkboxes in Modal */
.team-select-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.team-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

.team-checkbox-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.team-checkbox-item input[type="checkbox"]:checked + span {
    color: var(--accent-green);
    font-weight: 600;
}

/* Top Scorers Leaderboard Podium */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin: 40px 0;
}

.podium-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    position: relative;
    width: 180px;
    transition: var(--transition);
}

.podium-box.rank-1 {
    width: 220px;
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
    transform: translateY(-20px);
}

.podium-box.rank-2 { border-color: #c0c0c0; }
.podium-box.rank-3 { border-color: #cd7f32; }

.podium-rank {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    margin: 0 auto 12px auto;
}

.rank-1 .podium-rank { background: var(--gradient-gold); color: #000; }
.rank-2 .podium-rank { background: linear-gradient(135deg, #e0e0e0, #8c8c8c); color: #000; }
.rank-3 .podium-rank { background: linear-gradient(135deg, #e09f5e, #8c4c10); color: #fff; }

/* Responsive adjustments */
@media (max-width: 992px) {
    .app-container {
        flex-direction: column;
    }

    /* Transform Sidebar into Native Bottom Navigation Bar */
    .sidebar {
        display: flex !important;
        width: 100% !important;
        height: 68px !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        flex-direction: row !important;
        border-right: none !important;
        border-top: 1px solid var(--border-color) !important;
        padding: 0 !important;
        background: rgba(15, 21, 35, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        z-index: 1000 !important;
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.8) !important;
    }
    .sidebar-header,
    .sidebar > div:last-child,
    .sidebar-nav > div,
    .sidebar-nav a[href*="download_db"] {
        display: none !important;
    }
    .sidebar-nav {
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
        padding: 0 6px !important;
        width: 100% !important;
        gap: 0 !important;
        height: 100% !important;
    }
    .nav-item {
        flex: 1 !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 6px 2px !important;
        gap: 4px !important;
        border-left: none !important;
        border-bottom: 3px solid transparent;
        border-radius: 8px !important;
        font-size: 10px !important;
        color: var(--text-muted) !important;
    }
    .nav-item.active {
        border-bottom: 3px solid var(--accent-green) !important;
        border-left: none !important;
        background: rgba(0, 255, 136, 0.1) !important;
        color: var(--accent-green) !important;
    }
    .nav-item span {
        display: block !important;
        font-size: 10px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 68px !important;
        line-height: 1.1 !important;
    }
    .nav-item i {
        font-size: 18px !important;
        margin: 0 !important;
    }

    /* Expand Main Content Area for Smartphone screen (no left margin!) */
    .main-content {
        margin-left: 0 !important;
        max-width: 100vw !important;
        width: 100% !important;
        padding: 16px 14px 85px 14px !important;
    }
}

@media (max-width: 768px) {

    /* Top Header & Page Titles */
    .top-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 14px !important;
        margin-bottom: 20px !important;
    }
    .page-title h1 {
        font-size: 22px !important;
        line-height: 1.3 !important;
    }
    .top-header > div:last-child {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .top-header > div:last-child .btn,
    .top-header > div:last-child a {
        flex: 1 !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 10px 14px !important;
    }

    /* Cards, Stats Grid & Tournaments */
    .card {
        padding: 16px !important;
        margin-bottom: 16px !important;
    }
    .card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .card-header > div {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .stat-card {
        padding: 16px !important;
    }
    .tournament-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Responsive Tables with Smooth Touch Scroll */
    .table-responsive {
        border-radius: var(--radius-sm);
        border: 1px solid rgba(255, 255, 255, 0.08);
        -webkit-overflow-scrolling: touch;
    }
    .table th, .table td {
        padding: 10px 12px !important;
        font-size: 13px !important;
    }
    .table td .btn {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    /* Responsive Match Cards in Schedule */
    .match-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 14px !important;
    }
    .match-card > div:first-child {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.1) !important;
        padding-bottom: 8px !important;
        margin-bottom: 4px !important;
    }
    .match-teams {
        max-width: 100% !important;
        width: 100% !important;
        justify-content: space-between !important;
        gap: 8px !important;
        margin: 4px 0 !important;
    }
    .team-side {
        width: 40% !important;
        font-size: 14px !important;
    }
    .team-side span {
        font-size: 14px !important;
    }
    .score-box {
        min-width: 70px !important;
        padding: 6px 10px !important;
        font-size: 16px !important;
    }
    .match-card > div:last-child {
        width: 100% !important;
        justify-content: stretch !important;
        border-top: 1px dashed rgba(255, 255, 255, 0.1) !important;
        padding-top: 10px !important;
        gap: 8px !important;
    }
    .match-card > div:last-child .btn,
    .match-card > div:last-child a {
        flex: 1 !important;
        justify-content: center !important;
    }

    /* Responsive Modals & Scoreboard */
    .modal-content {
        max-width: 96% !important;
        max-height: 85vh !important;
        border-radius: 14px !important;
    }
    .modal-header, .modal-body, .modal-footer {
        padding: 16px !important;
    }
    /* Scoreboard modal adjustments on mobile */
    #modal_update_score .modal-body > div:first-child {
        padding: 16px 10px !important;
        gap: 8px !important;
    }
    #modal_home_team_name, #modal_away_team_name {
        font-size: 18px !important;
        margin: 6px 0 12px 0 !important;
    }
    .score-input-lg {
        width: 80px !important;
        height: 65px !important;
        font-size: 38px !important;
        line-height: 65px !important;
        border-radius: 10px !important;
    }
    #modal_update_score .modal-body > div:first-child > div:nth-child(4) div {
        font-size: 20px !important;
        padding: 8px 14px !important;
    }
    /* Scorer rows inside score modal */
    .scorer-row {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 10px !important;
    }
    .scorer-row select {
        width: 100% !important;
        flex: none !important;
    }
    .scorer-row input[name*="[goals]"] {
        width: 70px !important;
    }
    .scorer-row input[name*="[minute]"] {
        flex: 1 !important;
    }

    /* Stack Form Grid Columns Vertically on Mobile */
    .modal-body div[style*="grid-template-columns"],
    .card form div[style*="grid-template-columns"],
    form div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Top Skor Podium Responsive */
    .podium-container {
        flex-direction: column !important;
        align-items: center !important;
        gap: 16px !important;
        margin: 24px 0 !important;
    }
    .podium-box, .podium-box.rank-1 {
        width: 100% !important;
        max-width: 320px !important;
        transform: none !important;
    }
}

@media (max-width: 576px) {
    .page-title h1 {
        font-size: 20px !important;
    }
    .btn {
        padding: 8px 14px !important;
        font-size: 13px !important;
    }
}
