/* MODERN COLOR PALETTE */
:root {
    --primary: #4F46E5;       /* Indigo */
    --primary-dark: #4338ca;
    --success: #10B981;       /* Emerald */
    --danger: #EF4444;        /* Red */
    --background: #F1F5F9;    /* Slate 100 */
    --card-bg: #ffffff;
    --text-main: #1E293B;     /* Slate 800 */
    --text-muted: #64748B;    /* Slate 500 */
    --border-radius: 16px;
}

body {
    background-color: var(--background);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* --- NAVIGATION --- */
.navbar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding-bottom: 1rem;
}
.navbar-brand {
    font-weight: 800;
    letter-spacing: -0.5px;
    font-size: 1.5rem;
}

/* --- CARDS & CONTAINERS --- */
.card {
    border: none;
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

/* --- TYPOGRAPHY --- */
h2, h3, h5 {
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #0f172a;
}
.text-muted { color: var(--text-muted) !important; }

/* --- LEADERBOARD TABLE --- */
.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}
.table thead th {
    background-color: #F8FAFC;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #E2E8F0;
    padding: 1rem;
}
.table tbody td {
    vertical-align: middle;
    padding: 1rem;
    border-bottom: 1px solid #F1F5F9;
    font-size: 0.95rem;
}
.table-hover tbody tr:hover {
    background-color: #F8FAFC;
}

/* --- AVATAR CIRCLES --- */
.avatar-circle {
    width: 38px;
    height: 38px;
    background-color: #E0E7FF;
    color: var(--primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    
    /* UPDATED: Bigger margin to prevent ring clipping */
    margin: 8px 12px 8px 8px; 
    position: relative; /* Ensures z-index works */
}

/* --- RANK RINGS (UPDATED) --- */
/* box-shadow: horizontal vertical blur spread color */
.ring-gold {
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #F59E0B; /* White gap + Gold Ring */
    z-index: 10;
}
.ring-silver {
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #94A3B8; /* White gap + Silver Ring */
    z-index: 10;
}
.ring-bronze {
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #B45309; /* White gap + Bronze Ring */
    z-index: 10;
}

/* --- BADGES (W/L History) --- */
.history-pill {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    margin-right: 3px;
    color: white;
}
.pill-w { background-color: var(--success); }
.pill-l { background-color: var(--danger); opacity: 0.8; }

/* --- BUTTONS --- */
.btn {
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.btn-primary:active { transform: scale(0.98); }

/* --- FLOATING ACTION BUTTON (Add Game) --- */
.fab-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 400px;
}
.btn-fab {
    border-radius: 50px;
    padding: 16px;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* --- FORM ELEMENTS --- */
.form-select, .form-control {
    border-radius: 12px;
    padding: 12px;
    border: 1px solid #E2E8F0;
    background-color: #F8FAFC;
}
.form-select:focus, .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}