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

:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #10b981; /* Green */
    --primary-hover: #059669;
    --accent: #3b82f6; /* Blue */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(16px);
}

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

body {
    background: radial-gradient(circle at top right, #1e1b4b, var(--bg-dark), #020617);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.glass {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur); /* Safari */
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--primary);
    color: white;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-accent {
    background: var(--accent);
}

.btn-accent:hover {
    background: #2563eb;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
    color: white;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--primary);
}

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
}
.auth-card h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.match-card {
    padding: 1.5rem;
    transition: transform 0.2s;
    position: relative;
    overflow: hidden;
}

.match-card:hover {
    transform: translateY(-5px);
}

.match-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.badge {
    background: rgba(255,255,255,0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.badge.pending { color: #f59e0b; }
.badge.finished { color: var(--primary); }

.teams-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.team {
    text-align: center;
    flex: 1;
}

.team-name {
    font-weight: 600;
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.score-input {
    width: 50px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    outline: none;
    -moz-appearance: textfield;
}

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

.score-input:focus {
    border-color: var(--primary);
}

.vs-badge {
    font-weight: 800;
    color: var(--text-muted);
    padding: 0 1rem;
}

.match-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.points-display {
    color: var(--primary);
    font-weight: bold;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    display: none;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.leaderboard-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.leaderboard-row {
    transition: background 0.2s;
}

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

.rank-badge {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    font-weight: bold;
}
.rank-1 { background: #fbbf24; color: black; } 
.rank-2 { background: #cbd5e1; color: black; } 
.rank-3 { background: #b45309; color: white; } 

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    max-width: 600px;
    width: 90%;
    padding: 2rem;
}

.rules-list {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}
.rules-list li {
    margin-bottom: 1rem;
}
.points-highlight {
    color: var(--primary);
    font-weight: 800;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
}
.toast {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border-left: 4px solid var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
