:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glow: 0 0 20px rgba(59, 130, 246, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

body {
    background-color: #0b0f19;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 30%),
        radial-gradient(circle at 85% 30%, rgba(239, 68, 68, 0.1), transparent 30%);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 50px;
}

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

.glass-header {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 30px;
    border-radius: 0 0 15px 15px;
    box-shadow: var(--glow);
}

.animated-logo {
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.animated-logo span {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899, #3b82f6);
    background-size: 300% 100%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: rgbShine 4s linear infinite;
    margin-left: 6px;
}
@keyframes rgbShine {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

nav button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 20px;
    transition: all 0.3s;
}

nav button:hover, nav button.active {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}
.tab-content.active {
    display: block;
}

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

.glass-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.glass-card:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
}

.mb-2 { margin-bottom: 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;}

/* Inputs & Buttons */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

input[type="text"], input[type="number"] {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}
input[type="text"]:focus, input[type="number"]:focus {
    border-color: var(--primary);
}

button {
    padding: 12px 25px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-primary { background: linear-gradient(135deg, var(--primary), #2563eb); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--glow); }

.btn-danger { background: linear-gradient(135deg, var(--danger), #b91c1c); color: white; }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }

.btn-icon-only {
    padding: 10px;
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
}

.btn-secondary { background: #475569; color: white; }
.btn-secondary:hover { background: #334155; }

.icon-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    transform: scale(1.05);
}

/* Lists & Tables */
.styled-list { list-style: none; }
.styled-list li {
    background: rgba(0,0,0,0.3);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary);
    transition: transform 0.2s, background 0.2s;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.styled-list li:hover {
    transform: translateX(5px);
    background: rgba(0,0,0,0.5);
}
.styled-list li button {
    padding: 8px 15px;
    background: var(--danger);
    font-size: 0.9rem;
}

.table-responsive { overflow-x: auto; }
/* Tables */
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
th, td { padding: 12px 15px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.05); }
th { color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; }
.standings-table tbody tr {
    transition: background 0.2s, transform 0.2s;
    border-left: 4px solid transparent;
}
.standings-table tbody tr:hover {
    transform: scale(1.01);
    background: rgba(255,255,255,0.05);
}

/* Standings Ranks */
.rank-1 {
    background: linear-gradient(90deg, rgba(250, 204, 21, 0.15) 0%, transparent 100%) !important;
    border-left-color: #facc15 !important;
}
.rank-1 td:nth-child(2) { font-weight: 800; color: #fde047; }
.rank-1 td:first-child { color: #facc15; font-weight: 800; text-shadow: 0 0 10px rgba(250, 204, 21, 0.5); }

.rank-2 {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.1) 0%, transparent 100%) !important;
    border-left-color: #94a3b8 !important;
}
.rank-2 td:nth-child(2) { font-weight: 700; color: #e2e8f0; }
.rank-2 td:first-child { color: #94a3b8; font-weight: 800; }

.rank-3 {
    border-left-color: #b45309 !important;
}
.rank-3 td:first-child { color: #b45309; font-weight: 800; }

.rank-last {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, transparent 100%) !important;
    border-left-color: #ef4444 !important;
}
.rank-last td:nth-child(2) { color: #fca5a5; }
.rank-last td:first-child { color: #ef4444; font-weight: 800; }
.styled-table td:nth-child(2) { text-align: left; font-weight: 600; }

/* Matches Grid */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}
.match-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s;
    cursor: pointer;
}
.match-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}
.match-order {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.w-full { width: 100%; }
.relative-card { position: relative; }

.match-teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.match-score {
    background: rgba(0,0,0,0.4);
    padding: 5px 15px;
    border-radius: 20px;
    color: var(--primary);
    font-weight: 800;
    margin: 0 15px;
}
.club-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

/* Modal Score Inputs */
.score-input-modal {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    flex: 0 0 60px !important;
    background: rgba(0,0,0,0.3) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 12px !important;
    color: var(--primary) !important;
    font-size: 2rem !important;
    font-weight: 800 !important;
    text-align: center;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    transition: border 0.2s;
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}
.score-input-modal:focus {
    border-color: var(--primary) !important;
    outline: none !important;
    background: rgba(0,0,0,0.5) !important;
}
.score-input-modal::-webkit-outer-spin-button,
.score-input-modal::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

/* Status: Completed */
.completed-match {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
    opacity: 0.85;
}
.completed-match .match-order {
    color: #10b981;
}
.completed-match .match-score {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.completed-match .icon-btn {
    opacity: 0.5;
    border-color: transparent;
}
.completed-match .icon-btn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

.match-score {
    background: rgba(0,0,0,0.4);
    padding: 5px 15px;
    border-radius: 20px;
    color: var(--primary);
    font-weight: 800;
}

/* Bracket */
.bracket-container {
    display: flex;
    gap: 40px;
    margin-top: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
}
.cup-round {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.cup-round h3 {
    color: var(--primary);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    text-align: center;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px 8px 0 0;
    padding: 10px;
}

.btn-advance {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    margin-top: 30px;
    width: 100%;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-advance:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.4);
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .glass-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        border-radius: 0 0 10px 10px;
    }
    nav {
        display: flex;
        justify-content: center;
        width: 100%;
        gap: 5px;
    }
    nav button {
        margin-left: 0;
        font-size: 0.9rem;
        padding: 8px 12px;
        background: rgba(255,255,255,0.05);
        border-radius: 8px;
        flex: 1;
    }
    nav button.active {
        background: rgba(59, 130, 246, 0.2);
    }
    .input-group {
        flex-direction: column;
    }
    .matches-grid {
        grid-template-columns: 1fr;
    }
    .match-teams {
        font-size: 0.95rem;
    }
    .animated-logo {
        font-size: 1.2rem;
    }
    .animated-logo img {
        height: 1.5em !important;
    }
    .glass-card {
        padding: 15px;
    }
    th, td {
        padding: 8px 5px;
        font-size: 0.8rem;
    }
    .cup-round {
        flex: 0 0 260px;
    }
    .score-input-modal {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        font-size: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    #team-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    #team-list li > div:last-child {
        width: 100%;
        justify-content: flex-end;
    }
}


/* --- SPLASH SCREEN --- */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0b0f19;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

.splash-logo {
    width: 120px;
    height: auto;
    border-radius: 15px;
    animation: pulseLogo 1.2s ease-in-out infinite;
}

@keyframes pulseLogo {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.4)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 30px rgba(59, 130, 246, 0.8)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.4)); }
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Fix SweetAlert Select */
.swal2-select { background-color: #334155 !important; color: #f8fafc !important; border: 1px solid #475569 !important; border-radius: 8px; }
.swal2-select option { background-color: #1e293b; color: #f8fafc; }

/* Celebration Modal Responsive Styles */
.celeb-container { display:flex; flex-direction:column; justify-content:center; align-items:center; min-height: 70vh; padding: 20px; }
.celeb-trophy { font-size: 6rem; line-height: 1; margin-bottom: 10px; filter: drop-shadow(0 0 30px rgba(234, 179, 8, 0.6)); }
.celeb-title { font-size: 2.5rem; font-weight: 800; color: #f8fafc; margin-bottom: 20px; letter-spacing: 3px; text-align: center; word-break: break-word; }
.celeb-name { font-size: 4rem; font-weight: 900; color: #eab308; text-shadow: 0 0 40px rgba(234, 179, 8, 0.8); margin-bottom: 10px; line-height: 1; text-align: center; word-break: break-word; }
.celeb-club { font-size: 1.5rem; color: #94a3b8; margin-bottom: 30px; text-transform: uppercase; letter-spacing: 2px; text-align: center; word-break: break-word; }
.celeb-stats-container { display: flex; gap: 20px; justify-content: center; margin-top: 10px; flex-wrap: wrap; width: 100%; }
.celeb-stat-box { border-radius: 20px; padding: 20px 20px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.3); flex: 1; min-width: 120px; max-width: 200px; }
.celeb-stat-box.blue { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); }
.celeb-stat-box.green { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); }
.celeb-stat-label { font-size: 1rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.celeb-stat-value { font-size: 3.5rem; font-weight: 900; line-height: 1; }
.celeb-stat-value.blue { color: #3b82f6; text-shadow: 0 0 20px rgba(59,130,246,0.5); }
.celeb-stat-value.green { color: #10b981; text-shadow: 0 0 20px rgba(16,185,129,0.5); }
@media (min-width: 768px) { .celeb-trophy { font-size: 8rem; } .celeb-title { font-size: 3.5rem; letter-spacing: 5px; } .celeb-name { font-size: 6rem; } .celeb-club { font-size: 2.5rem; } .celeb-stat-box { padding: 25px 40px; } .celeb-stat-label { font-size: 1.2rem; letter-spacing: 2px; } .celeb-stat-value { font-size: 4.5rem; } }
