/* DA ZEVENT : fond noir, cartes gris très sombre, vert #00bd00, or #e7b22b, police Switzer */
:root {
  --bg: #000;
  --dark-800: #060606;
  --dark-500: #111;
  --dark-400: #171717;
  --dark-300: #1d1d1d;
  --dark: #222;
  --dark-200: #262626;
  --dark-100: #313131;
  --light-800: #515151;
  --light-600: #838383;
  --light-500: #9c9c9c;
  --light-300: #cdcdcd;
  --light-200: #e6e6e6;
  --primary: #00bd00;
  --primary-700: #007100;
  --primary-800: #004b00;
  --primary-900: #002500;
  --primary-bright: #66d766;
  --gold: #e7b22b;
  --gold-dark: #a67c00;
  --gold-light: #ffe095;
  --danger: #e5484d;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: #fff;
  font-family: Switzer, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  padding: 8px;
  /* Desktop : la page fait exactement la hauteur de la fenêtre, la grille prend ce qui reste (aucun calcul fixe). */
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.top, .filters, .foot { flex: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--dark-100); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--dark-400); border: 1px solid var(--dark-300); border-radius: var(--radius);
  padding: 8px 14px; margin-bottom: 8px;
}
.top .logo { height: 40px; width: auto; display: block; }
.top .title { display: flex; flex-direction: column; line-height: 1.1; }
.top .title strong { font-size: 15px; font-weight: 600; }
.top .title span { font-size: 11px; color: var(--light-500); }
.stats { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.stat {
  display: flex; flex-direction: column; align-items: flex-end;
  background: var(--dark-500); border: 1px solid var(--dark-200); border-radius: 8px; padding: 5px 12px; min-width: 96px;
}
.stat b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat.gold b { color: var(--gold); }
.stat.green b { color: var(--primary-bright); }
.stat small { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--light-600); }
.controls { display: flex; gap: 6px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 7px 12px; font-weight: 500; font-size: 13px;
  background: var(--dark-100); border: 1px solid var(--dark-100); color: #fff; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--dark); border-color: var(--light-800); }
.btn.on { background: var(--primary-800); border-color: var(--primary-700); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1200; }
.btn.gold:hover { background: var(--gold-light); }
.btn.green { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.green:hover { background: var(--primary-bright); }
.btn.sm { padding: 5px 9px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; }
.status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--light-500); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--light-800); }
.dot.ok { background: var(--primary); box-shadow: 0 0 0 3px rgba(0,189,0,.2); }
.dot.ko { background: var(--danger); box-shadow: 0 0 0 3px rgba(229,72,77,.25); }

/* ---------- Filtres ---------- */
.filters {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--dark-400); border: 1px solid var(--dark-300); border-radius: var(--radius);
  padding: 8px 14px; margin-bottom: 8px;
}
.filters.active { border-color: var(--primary-700); box-shadow: inset 0 0 0 1px var(--primary-900); }
.fgroup { display: flex; align-items: center; gap: 8px; }
.flabel { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--light-600); font-weight: 600; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500;
  background: var(--dark-500); border: 1px solid var(--dark-100); color: var(--light-300);
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--light-800); color: #fff; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .cnt { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 3px; border-radius: 999px; background: rgba(0,0,0,.35); font-size: 11px; text-align: center; }
.chip.on .cnt { background: rgba(0,0,0,.3); }
.fhint { margin-left: auto; font-size: 12px; color: var(--light-500); }
.fhint b { color: var(--gold); font-weight: 600; }

/* Étoile favori */
.star {
  background: none; border: 0; padding: 2px 4px; font-size: 17px; line-height: 1; color: var(--light-800);
  border-radius: 6px; transition: color .15s, transform .15s; flex-shrink: 0;
}
.star:hover { color: var(--gold-light); transform: scale(1.15); }
.star.on { color: var(--gold); }
.row .star { margin-left: auto; }
.detail .head .star { font-size: 24px; margin-left: 8px; }

/* ---------- Layout ---------- */
.grid {
  display: grid; gap: 8px;
  grid-template-columns: 330px minmax(0, 1fr) 380px;
  flex: 1 1 auto;
  min-height: 520px;
}
.panel {
  background: var(--dark-400); border: 1px solid var(--dark-300); border-radius: var(--radius);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.panel > header {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--dark-300);
  font-weight: 600; font-size: 14px;
}
.panel > header .count { color: var(--light-600); font-weight: 400; font-size: 12px; }
.panel > header svg { width: 18px; height: 18px; color: var(--primary-bright); }
.panel > header .spacer { flex: 1; }
.panel .body { overflow-y: auto; flex: 1; min-height: 0; padding: 8px; }
.empty { color: var(--light-600); font-size: 13px; text-align: center; padding: 24px 12px; }

/* ---------- Feed paliers ---------- */
.ev {
  display: flex; gap: 10px; padding: 10px; border-radius: 8px; background: var(--dark-500); border: 1px solid var(--dark-200);
  margin-bottom: 6px; cursor: pointer; transition: border-color .15s;
}
.ev:hover { border-color: var(--primary-700); }
.ev.fresh { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary-900); animation: pop .5s ease; }
@keyframes pop { from { transform: scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }
.ev img { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--dark-100); flex-shrink: 0; }
.ev .who { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--light-500); }
.ev .who b { color: #fff; font-weight: 600; }
.ev .goal { font-size: 13px; font-weight: 500; margin: 3px 0 2px; line-height: 1.3; }
.ev .amt { color: var(--primary-bright); font-weight: 600; font-size: 12px; }
.ev .amt span { color: var(--light-600); font-weight: 400; }

/* ---------- Liste streamers ---------- */
.toolbar { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--dark-300); flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] {
  flex: 1; min-width: 140px; background: var(--dark-500); border: 1px solid var(--dark-200); color: #fff; border-radius: 8px; padding: 7px 10px; outline: none;
}
.toolbar input[type=search]:focus { border-color: var(--primary-700); }
.toolbar select {
  background: var(--dark-500); border: 1px solid var(--dark-200); color: #fff; border-radius: 8px; padding: 7px 8px; outline: none;
}
.toolbar label.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--light-300); cursor: pointer; user-select: none; }
.toolbar label.chk input { accent-color: var(--primary); }

.row {
  display: grid; grid-template-columns: 44px minmax(0,1.1fr) minmax(0,1.6fr); gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 8px; background: var(--dark-500); border: 1px solid var(--dark-200); margin-bottom: 5px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.row:hover { border-color: var(--light-800); }
.row.sel { border-color: var(--primary-700); background: var(--primary-900); }
.row.off { opacity: .55; }
.row img { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--dark-100); }
.row .id { min-width: 0; }
.row .id .name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.row .id .meta { font-size: 12px; color: var(--light-500); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.row .id .meta .eur { color: var(--primary-bright); font-weight: 600; }
.row .id .meta .game { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.live.off { background: var(--light-800); }
.row .goal { min-width: 0; }
.row .goal .t { font-size: 12px; color: var(--light-300); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .goal .t.none { color: var(--light-800); font-style: italic; }
.row .goal .t.done { color: var(--gold); }
.bar { height: 6px; border-radius: 6px; background: var(--dark-100); overflow: hidden; margin: 5px 0 3px; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: 6px; transition: width .6s ease; }
.bar.hot i { background: linear-gradient(90deg, var(--primary), var(--gold)); }
.row .goal .n { display: flex; justify-content: space-between; font-size: 11px; color: var(--light-500); font-variant-numeric: tabular-nums; }
.row .goal .n b { color: #fff; font-weight: 500; }
.row .goal .n .hot { color: var(--gold); font-weight: 600; }
.badge { font-size: 10px; padding: 1px 6px; border-radius: 6px; background: var(--dark-100); color: var(--light-300); font-weight: 500; white-space: nowrap; }
.badge.gold { background: var(--gold-dark); color: #fff; }

/* ---------- Colonne droite : imminents + détail ---------- */
/* Colonne droite : « Ça va tomber » plafonné à 45 % (liste défilante), le détail garde au moins 55 % et reste toujours visible. */
.right { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.soon { flex: 0 1 auto; max-height: 45%; min-height: 150px; }
.soon .body { padding: 6px 8px; }
.detail { flex: 1 1 0; min-height: 0; }
.soon-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 5px 4px; border-bottom: 1px solid var(--dark-300); cursor: pointer; }
.soon-row:last-child { border-bottom: 0; }
.soon-row:hover { background: var(--dark-500); border-radius: 6px; }
.soon-row img { width: 30px; height: 30px; border-radius: 50%; }
.soon-row .n { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soon-row .g { font-size: 11px; color: var(--light-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soon-row .r { text-align: right; font-variant-numeric: tabular-nums; }
.soon-row .r b { display: block; color: var(--gold); font-size: 13px; }
.soon-row .r span { font-size: 10px; color: var(--light-600); }

.detail .head { display: flex; gap: 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--dark-300); }
.detail .head img { width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--dark-100); }
.detail .head .n { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.detail .head .m { font-size: 12px; color: var(--light-500); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.detail .head .m .eur { color: var(--primary-bright); font-weight: 600; font-size: 13px; }
.detail .actions { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--dark-300); flex-wrap: wrap; }
.detail .actions .btn { flex: 1; justify-content: center; }

/* Timeline des goals, reproduite du site : ligne verticale + points + cartes 100px */
.tl { display: flex; gap: 14px; padding: 12px 12px 12px 14px; }
.tl .line { width: 4px; background: var(--dark); border-radius: 4px; position: relative; flex-shrink: 0; }
.tl .line .seg { position: absolute; left: 0; width: 4px; background: var(--primary); }
.tl .line .pt { position: absolute; left: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--dark-300); z-index: 1; }
.tl .line .pt.done { background: var(--primary); }
.tl .line .pt.cur { background: var(--primary); border: 2px solid var(--dark-300); box-shadow: 0 0 0 2px var(--primary); }
.tl .cards { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.tl .card { height: 100px; padding: 10px 12px; border-radius: 6px; background: var(--dark-100); display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.tl .card h4 { margin: 0; font-size: 13px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tl .card h5 { margin: 0; font-size: 12px; font-weight: 400; color: rgba(255,255,255,.5); }
.tl .card h5 b { color: #fff; font-weight: 500; }
.tl .card.cur { background: var(--primary); }
.tl .card.cur h5 { color: rgba(255,255,255,.75); }
.tl .card.done { background: var(--primary); opacity: .5; }
.tl .card .rem { font-size: 11px; color: rgba(255,255,255,.85); font-weight: 500; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: 380px; }
.toast {
  display: flex; gap: 10px; align-items: center; background: var(--dark-400); border: 1px solid var(--primary); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.6); animation: slide .3s ease; cursor: pointer;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast img { width: 40px; height: 40px; border-radius: 50%; }
.toast .t1 { font-size: 11px; color: var(--primary-bright); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.toast .t2 { font-size: 13px; font-weight: 600; }
.toast .t3 { font-size: 12px; color: var(--light-300); }

.foot { text-align: center; font-size: 11px; color: var(--light-800); padding: 8px 0 2px; }
.foot a { color: var(--light-600); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  /* Tablette / petit écran : la page défile normalement, chaque panneau est plafonné et défile à l'intérieur. */
  body { height: auto; min-height: 100dvh; display: block; }
  .grid { grid-template-columns: 300px minmax(0,1fr); min-height: 0; }
  .right { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .panel { max-height: 70dvh; }
  .soon { max-height: 70dvh; min-height: 0; }
  .detail { min-height: 300px; }
}
@media (max-width: 800px) {
  body { padding: 6px; }
  .grid { grid-template-columns: 1fr; }
  .right { grid-template-columns: 1fr; }
  .stats { margin-left: 0; width: 100%; }
  .stat { flex: 1; min-width: 0; }
  .panel { max-height: none; }
  .panel .body { max-height: 60dvh; }
  .row { grid-template-columns: 40px minmax(0,1fr); }
  .row .goal { grid-column: 1 / -1; }
}
