:root {
    --bg: #0c0d10;
    --bg-2: #13151a;
    --panel: #181b21;
    --panel-2: #20242c;
    --line: #2a2f39;
    --text: #e9ebef;
    --muted: #8a92a3;
    --accent: #ff5a1f;
    --accent-2: #ff8a3d;
    --blue: #3b82f6;
    --red: #ef4444;
    --green: #22c55e;
    --yellow: #eab308;
    --team1: #3b9cff;
    --team2: #ff4d5e;
    --radius: 10px;
    --font-display: 'Rajdhani', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg);
    background-image: radial-gradient(1200px 500px at 70% -10%, rgba(255, 90, 31, .10), transparent 60%);
    color: var(--text);
    font: 15px/1.5 var(--font-body);
    min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: .02em; margin: 0 0 .5em; line-height: 1.1; }
h1 { font-size: 2.2rem; text-transform: uppercase; }
h2 { font-size: 1.5rem; text-transform: uppercase; }
h3 { font-size: 1.15rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Layout */
.nav {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; gap: 24px;
    padding: 0 24px; height: 60px;
    background: rgba(12, 13, 16, .85); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--text); text-transform: uppercase; letter-spacing: .05em; }
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 18px; flex: 1; }
.nav-links a { color: var(--muted); font-weight: 600; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 12px; }
.container { max-width: 1180px; margin: 0 auto; padding: 32px 20px 80px; }

/* ---------- Composants */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--panel-2); color: var(--text);
    font: 600 .9rem var(--font-body); cursor: pointer; text-decoration: none !important;
    transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { border-color: #3b4250; background: #262b34; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #ff6d38; border-color: #ff6d38; }
.btn-danger { background: transparent; border-color: rgba(239, 68, 68, .5); color: #ff8080; }
.btn-danger:hover { background: rgba(239, 68, 68, .12); border-color: var(--red); }
.btn-success { background: transparent; border-color: rgba(34, 197, 94, .5); color: #6ee79b; }
.btn-success:hover { background: rgba(34, 197, 94, .12); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-xl { padding: 18px 48px; font: 700 1.4rem var(--font-display); text-transform: uppercase; letter-spacing: .08em; }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-discord:hover { background: #6b76f5; border-color: #6b76f5; }
.btn-google { background: #fff; border-color: #fff; color: #1f1f1f; }
.btn-google:hover { background: #eee; border-color: #eee; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.badge-green { color: #6ee79b; border-color: rgba(34, 197, 94, .4); background: rgba(34, 197, 94, .08); }
.badge-yellow { color: #fcd34d; border-color: rgba(234, 179, 8, .4); background: rgba(234, 179, 8, .08); }
.badge-red { color: #ff8080; border-color: rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .08); }
.badge-orange { color: var(--accent-2); border-color: rgba(255, 90, 31, .4); background: rgba(255, 90, 31, .08); }

.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--panel-2); flex: none; }
.avatar-lg { width: 96px; height: 96px; border: 3px solid var(--accent); }
.elo { font-family: var(--font-display); font-weight: 700; color: var(--accent-2); }
.delta-pos { color: var(--green); font-weight: 700; }
.delta-neg { color: var(--red); font-weight: 700; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; border: 1px solid; }
.alert-success { background: rgba(34, 197, 94, .08); border-color: rgba(34, 197, 94, .4); color: #a7f3c0; }
.alert-error { background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .4); color: #fecaca; }

/* ---------- Formulaires */
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; color: var(--muted); }
input[type=text], input[type=number], input[type=search], select, textarea, input[type=file] {
    width: 100%; padding: 10px 12px; border-radius: 8px;
    background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
    font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field + .field { margin-top: 14px; }
.error-text { color: #ff8080; font-size: .85rem; margin-top: 4px; }

/* ---------- Tableaux */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ---------- Accueil */
.hero { text-align: center; padding: 80px 20px 40px; }
.hero h1 { font-size: clamp(2.5rem, 7vw, 4.8rem); margin-bottom: 12px; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 560px; margin: 0 auto 32px; }
.feature { padding: 22px; }
.feature .num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--accent); }

/* ---------- Jouer */
.queue-box { text-align: center; padding: 48px 20px; }
.queue-count { font-family: var(--font-display); font-size: 4rem; font-weight: 700; line-height: 1; }
.queue-count small { font-size: 1.5rem; color: var(--muted); }
.pulse { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); display: inline-block; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 31, .7); } 70% { box-shadow: 0 0 0 16px rgba(255, 90, 31, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0); } }
.stat { padding: 16px; text-align: center; }
.stat .v { font-family: var(--font-display); font-size: 2rem; font-weight: 700; }
.stat .l { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---------- Match */
.match-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.timer { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; color: var(--accent-2); min-width: 60px; text-align: right; }
.teams { display: grid; grid-template-columns: 1fr minmax(240px, 320px) 1fr; gap: 16px; align-items: start; }
.team { border-top: 3px solid; }
.team-1 { border-top-color: var(--team1); }
.team-2 { border-top-color: var(--team2); }
.team-1 h2 { color: var(--team1); }
.team-2 h2 { color: var(--team2); }
.team.turn { box-shadow: 0 0 0 1px var(--accent), 0 0 24px rgba(255, 90, 31, .25); }
.player { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.player + .player { border-top: 1px solid var(--line); }
.player .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .ubi { font-size: .78rem; color: var(--muted); }
.captain-tag { font-size: .65rem; font-weight: 800; color: #111; background: var(--yellow); padding: 1px 5px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }
.pool-player { width: 100%; text-align: left; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--text); display: flex; align-items: center; gap: 10px; font: inherit; }
button.pool-player { cursor: pointer; }
button.pool-player:hover { border-color: var(--accent); }
.pool-player + .pool-player, form + form .pool-player { margin-top: 8px; }

.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.map-card { position: relative; border-radius: 8px; border: 1px solid var(--line); background: linear-gradient(135deg, #232833, #171a20); padding: 22px 14px; text-align: center; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; text-transform: uppercase; color: var(--text); width: 100%; }
button.map-card { cursor: pointer; }
button.map-card:hover { border-color: var(--red); background: linear-gradient(135deg, #3a1d22, #1a1416); }
.map-card.banned { opacity: .35; text-decoration: line-through; }
.map-card.picked { border-color: var(--accent); box-shadow: 0 0 24px rgba(255, 90, 31, .3); }
.map-card .by { display: block; font: 600 .7rem var(--font-body); text-transform: none; color: var(--muted); text-decoration: none; margin-top: 4px; }

.final-map { text-align: center; padding: 40px 20px; background: linear-gradient(135deg, rgba(255, 90, 31, .15), transparent), var(--panel); }
.final-map .map-name { font-family: var(--font-display); font-size: 3rem; font-weight: 700; text-transform: uppercase; }
.score { font-family: var(--font-display); font-size: 3rem; font-weight: 700; }

/* ---------- Profil */
.profile-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.linked { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.linked:last-child { border-bottom: none; }

.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); }
.pagination .active { color: var(--text); border-color: var(--accent); }

footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 32px 20px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
    .teams { grid-template-columns: 1fr; }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nav { gap: 12px; padding: 0 16px; }
    .nav-links { gap: 12px; overflow-x: auto; }
}
@media (max-width: 600px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .nav-user .uname { display: none; }
}
