/* ==========================================================================
   KIKS TOURNAMENT — DESIGN SYSTEM ESPORTS & GLASSMORPHISM
   ========================================================================== */

:root {
    --bg-dark: #0b0c10;
    --bg-card: rgba(22, 26, 38, 0.75);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --bg-card-hover: rgba(30, 36, 52, 0.85);
    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.35);
    --accent-secondary: #06b6d4;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-sub: #6b7280;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --glass-blur: blur(16px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- HEADER & NAVIGATION --- */
.site-header {
    background: rgba(11, 12, 16, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--bg-card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.brand-mark {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 900;
    box-shadow: 0 0 15px var(--accent-glow);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.main-nav a:not(.btn) {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.main-nav a:not(.btn):hover,
.main-nav a.nav-active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- CARTE & GLASSMORPHISM --- */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-main);
    transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- BOUTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
    color: #fff;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--bg-card-border);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-block { width: 100%; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }

/* --- BADGES & BADGES DE STATUT --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.badge.open {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.closed, .badge.completed {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge.ongoing {
    background: rgba(245, 158, 11, 0.15);
    color: #fde047;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* --- TOASTS / MESSAGES FLASH --- */
.flash-wrap {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flash {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    backdrop-filter: var(--glass-blur);
    animation: fadeIn 0.3s ease-out;
}

.flash-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.flash-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* --- GRILLES BENTO & LAYOUTS --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.two-cols {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* --- TABS SYSTEM --- */
.tabs-header {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--bg-card-border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--text-main); }
.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease-in; }

/* --- FOOTER --- */
.footer-v2 {
    background: rgba(11, 12, 16, 0.9);
    border-top: 1px solid var(--bg-card-border);
    padding: 32px 0;
    margin-top: 60px;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .two-cols { grid-template-columns: 1fr; }
    .main-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-dark);
        padding: 20px;
        border-bottom: 1px solid var(--bg-card-border);
    }
    body.nav-open .main-nav { display: flex; }
    .mobile-nav-toggle { display: block; }
}