/* =============================================================
   FC27 — Thème "stade de nuit"
   ============================================================= */
:root {
  --bg: #070d0b;
  --bg-2: #0c1512;
  --panel: #111c18;
  --panel-2: #16241f;
  --line: #213430;
  --line-2: #2c453f;
  --text: #e8f2ee;
  --muted: #8ba69d;
  --dim: #5d7770;
  --accent: #22d3a0;
  --accent-2: #13a87d;
  --accent-ink: #032018;
  --gold: #f5c84c;
  --red: #ff5d6c;
  --blue: #5aa9ff;
  --purple: #a78bfa;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, .6);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Barlow Condensed', 'Arial Narrow', var(--font);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(34, 211, 160, .09), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(90, 169, 255, .06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .01em; margin: 0; line-height: 1.1; }
h1 { font-size: 34px; text-transform: uppercase; }
h2 { font-size: 22px; text-transform: uppercase; }
h3 { font-size: 18px; }
p { margin: 0 0 .6em; }
img { max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(17, 28, 24, .95), rgba(7, 13, 11, .95));
  border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-badge {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #0e8f6a); color: var(--accent-ink);
  font: 800 17px var(--display); box-shadow: 0 0 24px rgba(34, 211, 160, .35);
}
.brand-name { font: 700 20px var(--display); text-transform: uppercase; line-height: 1; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.nav-label { font-size: 11px; color: var(--dim); letter-spacing: .14em; text-transform: uppercase; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  color: var(--muted); font-weight: 500; text-decoration: none; transition: .15s;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: rgba(34, 211, 160, .12); color: var(--accent); }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: var(--text); text-decoration: none; }
.me-chip:hover { background: var(--panel-2); text-decoration: none; }
.me-chip small { display: block; color: var(--muted); font-size: 12px; }

.main { padding: 28px 34px 80px; max-width: 1280px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { color: var(--muted); margin: 6px 0 0; }
.kicker { color: var(--accent); font: 600 12px var(--font); letter-spacing: .16em; text-transform: uppercase; margin-bottom: 4px; }

.mobile-bar { display: none; }

/* ---------- Composants ---------- */
.card {
  background: linear-gradient(180deg, var(--panel), rgba(17, 28, 24, .7));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { font-size: 17px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font: 600 14px var(--font);
  cursor: pointer; transition: .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #3fe6b5; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-2); }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-discord:hover { background: #6d78f5; border-color: #6d78f5; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
}
.b-green { background: rgba(34, 211, 160, .12); color: var(--accent); border-color: rgba(34, 211, 160, .25); }
.b-gold { background: rgba(245, 200, 76, .12); color: var(--gold); border-color: rgba(245, 200, 76, .25); }
.b-red { background: rgba(255, 93, 108, .12); color: var(--red); border-color: rgba(255, 93, 108, .25); }
.b-blue { background: rgba(90, 169, 255, .12); color: var(--blue); border-color: rgba(90, 169, 255, .25); }
.b-purple { background: rgba(167, 139, 250, .12); color: var(--purple); border-color: rgba(167, 139, 250, .25); }

/* Formulaires */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.input, input[type=text], input[type=password], input[type=number], input[type=url], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); font: 14px var(--font); outline: none; transition: .15s;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 160, .15); }
input[type=color] { width: 44px; height: 38px; padding: 2px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.hint { font-size: 12px; color: var(--dim); }
.error-box { background: rgba(255, 93, 108, .1); border: 1px solid rgba(255, 93, 108, .3); color: #ffb3bb; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.info-box { background: rgba(90, 169, 255, .08); border: 1px solid rgba(90, 169, 255, .25); color: #bcd9ff; padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.info-box b { color: #fff; }

/* Onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 600; cursor: pointer; border: 0; background: none; border-bottom: 2px solid transparent; font-size: 14px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 6px 12px; border-radius: 7px; font: 600 13px var(--font); cursor: pointer; }
.seg button.active { background: var(--panel-2); color: var(--text); }

/* Tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 600; background: var(--bg-2); position: sticky; top: 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sorted { color: var(--accent); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Avatars */
.avatar {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  font: 700 15px var(--display); color: #04140f; text-transform: uppercase;
}
.avatar.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 26px; }
.avatar.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 12px; }

/* Stat tiles */
.tile { padding: 16px; }
.tile .v { font: 700 32px var(--display); line-height: 1; }
.tile .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-top: 6px; }

/* Listes */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.empty { text-align: center; color: var(--muted); padding: 30px 16px; }
.empty svg { width: 36px; height: 36px; opacity: .4; margin-bottom: 8px; }

/* Résultats V/N/D */
.res { width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; font: 700 13px var(--display); }
.res.V { background: rgba(34, 211, 160, .18); color: var(--accent); }
.res.N { background: rgba(139, 166, 157, .18); color: var(--muted); }
.res.D { background: rgba(255, 93, 108, .18); color: var(--red); }

/* Carte joueur façon FUT */
.pcard {
  position: relative; border-radius: 16px; padding: 16px 14px 14px; overflow: hidden; text-align: center;
  background: linear-gradient(160deg, #2a2412 0%, #17140b 45%, #0f1a16 100%);
  border: 1px solid rgba(245, 200, 76, .3); cursor: pointer; transition: .2s; color: var(--text); text-decoration: none; display: block;
}
.pcard:hover { transform: translateY(-3px); border-color: var(--gold); text-decoration: none; box-shadow: 0 12px 30px -10px rgba(245, 200, 76, .3); }
.pcard .ovr { position: absolute; left: 14px; top: 10px; font: 800 34px var(--display); color: var(--gold); line-height: 1; }
.pcard .pos { position: absolute; left: 15px; top: 44px; font: 700 14px var(--display); color: var(--gold); opacity: .85; }
.pcard .rate { position: absolute; right: 12px; top: 12px; }
.pcard .avatar { margin: 18px auto 10px; }
.pcard .nm { font: 700 19px var(--display); text-transform: uppercase; }
.pcard .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(245, 200, 76, .18); }
.pcard .stats b { display: block; font: 700 18px var(--display); }
.pcard .stats span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* Terrain */
.pitch-wrap { position: relative; width: 100%; max-width: 560px; margin: 0 auto; }
.pitch {
  position: relative; width: 100%; aspect-ratio: 68 / 100; border-radius: 14px; overflow: hidden; touch-action: none;
  background:
    repeating-linear-gradient(180deg, #11402f 0 10%, #0f3a2b 10% 20%);
  border: 2px solid rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, .45);
}
.pitch .ln { position: absolute; border: 2px solid rgba(255, 255, 255, .22); pointer-events: none; }
.pitch .half { left: 0; right: 0; top: 50%; border-width: 2px 0 0 0; }
.pitch .circle { width: 26%; aspect-ratio: 1; left: 37%; top: 50%; transform: translateY(-50%); border-radius: 50%; }
.pitch .box-t { left: 20%; right: 20%; top: -2px; height: 15%; }
.pitch .box-b { left: 20%; right: 20%; bottom: -2px; height: 15%; }
.pitch .six-t { left: 36%; right: 36%; top: -2px; height: 5.5%; }
.pitch .six-b { left: 36%; right: 36%; bottom: -2px; height: 5.5%; }
.token {
  position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: grab; user-select: none; z-index: 2; width: 84px;
}
.token.readonly { cursor: default; }
.token .dot {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: #0b1512; border: 2px solid var(--accent); color: var(--accent); font: 700 13px var(--display);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5); transition: transform .15s;
}
.token.filled .dot { background: var(--accent); color: var(--accent-ink); border-color: #fff; }
.token.selected .dot { transform: scale(1.15); box-shadow: 0 0 0 4px rgba(245, 200, 76, .6); }
.token .nm {
  font: 600 11px var(--font); background: rgba(0, 0, 0, .65); padding: 1px 7px; border-radius: 6px;
  max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.token.dragging { cursor: grabbing; z-index: 5; }
.bench { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--line-2); cursor: pointer; font-size: 13px; color: var(--text);
}
.chip:hover { border-color: var(--accent); }
.chip.on { border-color: var(--accent); background: rgba(34, 211, 160, .12); }
.chip.used { opacity: .45; }

/* Planning */
.day-label { font: 700 14px var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 8px; }
.event { display: grid; grid-template-columns: 74px 1fr auto; gap: 16px; align-items: center; }
.event .time { text-align: center; border-right: 1px solid var(--line); padding-right: 14px; }
.event .time b { display: block; font: 700 24px var(--display); line-height: 1; }
.event .time span { font-size: 12px; color: var(--muted); }
.rsvp { display: inline-flex; gap: 4px; }
.rsvp button { border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); border-radius: 8px; padding: 6px 10px; cursor: pointer; font: 600 13px var(--font); }
.rsvp button:hover { color: var(--text); }
.rsvp .on.yes { background: rgba(34, 211, 160, .15); border-color: var(--accent); color: var(--accent); }
.rsvp .on.maybe { background: rgba(245, 200, 76, .15); border-color: var(--gold); color: var(--gold); }
.rsvp .on.no { background: rgba(255, 93, 108, .15); border-color: var(--red); color: var(--red); }
.people { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

/* Coach */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pulse { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.moment { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.moment:last-child { border-bottom: 0; }
.ts { font: 700 15px var(--display); color: var(--gold); background: rgba(245, 200, 76, .1); border: 1px solid rgba(245, 200, 76, .25); border-radius: 8px; padding: 4px 0; text-align: center; cursor: pointer; height: fit-content; }
.ts:hover { background: rgba(245, 200, 76, .2); }
.alt { margin-top: 6px; padding: 8px 12px; border-left: 3px solid var(--accent); background: rgba(34, 211, 160, .06); border-radius: 0 8px 8px 0; font-size: 14px; }
.video-box { border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16 / 9; border: 1px solid var(--line); }
.video-box video, .video-box iframe { width: 100%; height: 100%; display: block; border: 0; }
.bubble { padding: 10px 13px; border-radius: 12px; font-size: 14px; max-width: 90%; white-space: pre-wrap; }
.bubble.user { background: var(--panel-2); align-self: flex-end; }
.bubble.coach { background: rgba(167, 139, 250, .1); border: 1px solid rgba(167, 139, 250, .25); align-self: flex-start; }
.note-ring { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font: 800 28px var(--display); flex: none; }
ul.clean { margin: 0; padding-left: 18px; }
ul.clean li { margin: 4px 0; }
.progress { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; border: 1px solid var(--line); }
.progress > div { height: 100%; background: var(--accent); transition: width .2s; }

/* Modale */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
@keyframes fade { from { opacity: 0; } }

/* Notifications */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 4px solid var(--accent); padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; font-size: 14px; animation: fade .2s; }
.toast.err { border-left-color: var(--red); }

/* Pages d'accueil (connexion) */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-hero { text-align: center; margin-bottom: 22px; }
.auth-hero .brand-badge { width: 64px; height: 64px; font-size: 26px; margin: 0 auto 14px; border-radius: 18px; }

.spinner { width: 22px; height: 22px; border: 3px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px; }

.chart svg { width: 100%; height: auto; display: block; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--bg-2); border: 1px solid var(--line); padding: 8px 10px; border-radius: 8px; word-break: break-all; }

/* ---------- Mobile ---------- */
@media (max-width: 1000px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .dash { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .shell.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 30; }
  .mobile-bar {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20; background: rgba(7, 13, 11, .92); backdrop-filter: blur(8px);
  }
  .main { padding: 20px 16px 80px; }
  h1 { font-size: 28px; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .event { grid-template-columns: 58px 1fr; }
  .event > :last-child { grid-column: 1 / -1; }
}
