/* ═══════════════════════════════════════
   VALORANT-LIVE.CSS
═══════════════════════════════════════ */

:root {
  --valo-red:     #ff4655;
  --valo-red-dim: rgba(255,70,85,.15);
  --valo-red-glow:0 0 20px rgba(255,70,85,.4);
  --valo-dark:    #0f1923;
  --valo-cream:   #ece8e1;
}

body { overflow: hidden; height: 100vh; background: var(--bg-void); }
.valo-acc { color: var(--valo-red); }

/* ══════════════════════════════════════
   TOPBAR
══════════════════════════════════════ */
#vtb {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 52px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  background: rgba(15,25,35,.97);
  border-bottom: 1px solid rgba(255,70,85,.2);
  user-select: none; overflow: hidden;
}
.vtb-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--valo-red), #ff8c94, transparent);
  opacity: .7;
}

.vtb-brand {
  font-family: var(--font-title); font-size: 17px; letter-spacing: 3px;
  color: var(--text-primary); text-decoration: none; flex-shrink: 0;
  transition: color var(--t-fast);
}
.vtb-brand:hover { color: var(--text-primary); }

.vtb-nav { display: flex; gap: 2px; flex-shrink: 0; }
.vtb-link {
  padding: 4px 10px; border-radius: var(--r-sm); font-size: 11px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none; transition: all var(--t-base);
}
.vtb-link:hover { color: var(--valo-red); background: var(--valo-red-dim); }
.vtb-link.active { color: var(--valo-red); background: var(--valo-red-dim); }

.vtb-sep { width: 1px; height: 24px; background: rgba(255,255,255,.1); flex-shrink: 0; margin: 0 4px; }

.vtb-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.valo-dot-status {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.valo-dot-status.ok      { background: #1aff8c; box-shadow: 0 0 6px #1aff8c; animation: pulse 2s infinite; }
.valo-dot-status.loading { background: var(--text-muted); animation: none; }
.valo-dot-status.error   { background: var(--valo-red); box-shadow: 0 0 6px var(--valo-red); animation: none; }

.valo-btn {
  border-color: rgba(255,70,85,.4); color: var(--valo-red);
}
.valo-btn:hover { background: var(--valo-red-dim); border-color: var(--valo-red); box-shadow: var(--valo-red-glow); }

/* ══════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════ */
#valo-main {
  position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
  display: flex; overflow: hidden;
}

/* ── RIGHT PANEL – Chat ── */
#valo-panel-right {
  display: none; flex-direction: column;
  width: 300px; flex-shrink: 0;
  background: var(--bg-dark);
  border-left: 1px solid rgba(255,70,85,.1);
}
#valo-panel-right.open { display: flex; }
#valo-chat-hdr {
  padding: 8px 14px; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,70,85,.12);
  display: flex; align-items: center;
}
.valo-chat-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-title); font-size: 14px; letter-spacing: 2px; color: var(--text-secondary);
}
.twitch-dot { width: 8px; height: 8px; border-radius: 50%; background: #9147ff; box-shadow: 0 0 8px #9147ff; }
#valo-chat-body { flex: 1; overflow: hidden; }
#valo-chat-body iframe { width: 100%; height: 100%; border: none; }

/* Bouton LIVE topbar */
.vtb-live-btn { text-decoration: none; font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.vtb-live-btn:hover { text-decoration: none; }
#vtb-chat-btn.active { background: rgba(145,71,255,.2); border-color: #9147ff; color: #9147ff; }

/* ── LEFT PANEL ── */
#valo-panel-left {
  width: 220px; flex-shrink: 0;
  background: var(--bg-dark);
  border-right: 1px solid rgba(255,70,85,.1);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}
#valo-panel-left::-webkit-scrollbar { width: 2px; }

/* Proxy card */
#valo-proxy-card {
  padding: 16px;
  border-bottom: 1px solid rgba(255,70,85,.12);
  flex-shrink: 0;
}
.vpc-hdr {
  font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--valo-red); margin-bottom: 10px;
}
#vpc-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 12px;
}
.vpc-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.vpc-dot.online  { background: #1aff8c; box-shadow: 0 0 6px #1aff8c; animation: pulse 2s infinite; }
.vpc-dot.idle    { background: var(--gold-1); }
.vpc-dot.offline { background: rgba(255,255,255,.25); }

/* Game info panel */
#valo-game-info {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,70,85,.1);
  flex-shrink: 0;
}
#valo-game-info.hidden { display: none; }
.vgi-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 12px;
}
.vgi-row:last-child { border-bottom: none; }
.vgi-label { color: var(--text-muted); font-weight: 600; letter-spacing: .5px; }
.vgi-val { color: var(--text-secondary); font-weight: 700; }
.vgi-phase.pregame { color: var(--gold-1); }
.vgi-phase.ingame  { color: #1aff8c; }

/* ── CENTER PANEL ── */
#valo-panel-center {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}
#valo-panel-center::-webkit-scrollbar { width: 3px; }

/* Stream */
#stream-wrap {
  flex-shrink: 0; position: relative; aspect-ratio: 16/9;
  background: #000; overflow: hidden;
}
#stream-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
#stream-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: var(--bg-void);
}
.stream-ph-icon { font-size: 36px; color: var(--valo-red); opacity: .5; }
.stream-ph-text { font-size: 13px; color: var(--text-muted); }
.stream-ph-text strong { color: var(--text-primary); }

/* Bouton LIVE actif */
#vtb-live-btn.active { background: rgba(255,70,85,.25); border-color: var(--valo-red); color: var(--valo-red); box-shadow: var(--valo-red-glow); }
.stream-badge {
  position: absolute; bottom: 10px; left: 12px; z-index: 10;
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.7); padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700; color: #fff; letter-spacing: 1px;
  border: 1px solid rgba(255,255,255,.15);
}

.valo-glow-line {
  height: 2px; flex-shrink: 0;
  background: linear-gradient(90deg, transparent, var(--valo-red), #ff8c94, transparent);
  opacity: .6;
}

/* ══════════════════════════════════════
   LIVE PANEL
══════════════════════════════════════ */
#valo-live-panel {
  padding: 16px; flex: 1; border-radius: var(--r-lg);
  background-size: cover; background-position: center;
  transition: background-image .5s ease;
}

/* Empty states */
.vlive-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; gap: 12px; text-align: center;
}
.vlive-empty-icon { font-size: 36px; opacity: .5; }
.vlive-empty-title { font-family: var(--font-title); font-size: 18px; letter-spacing: 2px; color: var(--text-secondary); }
.vlive-empty-sub { font-size: 13px; color: var(--text-muted); line-height: 1.6; max-width: 360px; }
.vlive-empty-sub code { background: var(--bg-card); padding: 2px 6px; border-radius: 3px; font-family: var(--font-mono); color: var(--valo-red); font-size: 12px; }

/* Header row (map / mode / score / phase) */
.vsb-header {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 1px solid rgba(255,70,85,.2);
  flex-wrap: wrap;
}
.vsb-map  { font-family: var(--font-title); font-size: 24px; letter-spacing: 3px; color: var(--text-primary); }
.vsb-mode { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); }
.vsb-mode-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-secondary); background: rgba(255,255,255,.04);
  border: 1px solid var(--border-dark); border-radius: 20px; padding: 4px 12px;
}
.vsb-score {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-title); font-size: 26px; letter-spacing: 2px;
}
.score-red  { color: #ff7080; }
.score-blue { color: #6ab0ff; }
.score-sep  { color: var(--text-muted); font-size: 18px; }
.vsb-state-badge {
  margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 10px; border-radius: 3px;
}
.vsb-state-badge.pregame { background: rgba(245,184,56,.12); border: 1px solid rgba(245,184,56,.4); color: var(--gold-1); }
.vsb-state-badge.ingame  { background: rgba(26,255,140,.10);  border: 1px solid rgba(26,255,140,.4);  color: #1aff8c; }

/* Section title */
.vlive-section-title {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 12px;
}

/* ── TEAMS GRID (côte-à-côte) ─────────────────────────────────── */
.vlive-teams-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.vlive-team-col {
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--border-dark);
}
.vlive-team-col.my-team { border-color: rgba(255,70,85,.35); }

.vlive-team-hdr {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
}
.vlive-team-col.red  .vlive-team-hdr { background: rgba(255,70,85,.1);  border-bottom: 1px solid rgba(255,70,85,.15);  color: #ff7080; }
.vlive-team-col.blue .vlive-team-hdr { background: rgba(59,137,214,.1); border-bottom: 1px solid rgba(59,137,214,.15); color: #6ab0ff; }

.vlive-team-score {
  font-family: var(--font-title); font-size: 20px; margin-left: auto; letter-spacing: 1px;
}
.vlive-team-score.score-red  { color: #ff7080; }
.vlive-team-score.score-blue { color: #6ab0ff; }

.vlive-myteam-badge {
  font-size: 9px; padding: 1px 7px; border-radius: 20px;
  background: var(--valo-red-dim); border: 1px solid rgba(255,70,85,.4); color: var(--valo-red);
  text-transform: uppercase; letter-spacing: 1px;
}

.vlive-players-row {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px;
}
.vlive-waiting { font-size: 13px; color: var(--text-muted); padding: 8px; }

/* ── CLASSEMENT FFA (Match à mort solo — pas d'équipes) ─────────── */
.vlive-ffa-list { display: flex; flex-direction: column; gap: 6px; }
.vlive-ffa-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; border-radius: var(--r-md);
  background: rgba(20,22,32,.7); border: 1px solid var(--border-dark);
}
.vlive-ffa-row.is-me { border-color: rgba(255,70,85,.4); background: rgba(255,70,85,.06); }
.vlive-ffa-rank { width: 32px; font-family: var(--font-title); font-size: 14px; color: var(--text-muted); flex-shrink: 0; }
.vlive-ffa-row:first-child .vlive-ffa-rank { font-size: 18px; }
.vlive-ffa-icon { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.vlive-ffa-name { font-weight: 600; font-size: 13px; color: var(--text-primary); flex: 1; min-width: 0; }
.vlive-me-badge.inline {
  display: inline-block; font-size: 9px; padding: 1px 6px; border-radius: 20px;
  background: var(--valo-red-dim); border: 1px solid rgba(255,70,85,.4); color: var(--valo-red);
  text-transform: uppercase; letter-spacing: 1px; margin-left: 6px; vertical-align: middle;
}
.vlive-ffa-kda { font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary); flex-shrink: 0; }
.vlive-ffa-hs, .vlive-ffa-weapon { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
@media (max-width: 640px) {
  .vlive-ffa-weapon { display: none; }
}

/* ── PLAYER CARDS (ingame) ────────────────────────────────────── */
.vlive-player-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; width: 80px; text-align: center; padding: 6px 4px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.02);
  border: 1px solid transparent;
}
.vlive-player-card.is-me {
  background: rgba(255,70,85,.07);
  border-color: rgba(255,70,85,.25);
}
.vlive-player-card.is-me .vlive-agent-icon,
.vlive-player-card.is-me .vlive-agent-noicon {
  border-color: var(--valo-red); box-shadow: 0 0 10px rgba(255,70,85,.4);
}

.vlive-agent-wrap { position: relative; }

.vlive-agent-icon {
  width: 56px; height: 56px; object-fit: contain; border-radius: 50%;
  border: 2px solid var(--border-dark); background: var(--bg-card);
  transition: box-shadow var(--t-base), border-color var(--t-base);
}
.vlive-agent-noicon {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--border-dark); background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-muted);
}
.vlive-agent-name {
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 78px;
}

/* Role badge */
.vlive-role-badge {
  font-size: 8px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  padding: 1px 5px; border-radius: 10px;
}
.vlive-role-badge.role-duelist    { background: rgba(255,80,80,.15);   color: #ff8888; border: 1px solid rgba(255,80,80,.3); }
.vlive-role-badge.role-controller { background: rgba(120,80,200,.15);  color: #bb88ff; border: 1px solid rgba(120,80,200,.3); }
.vlive-role-badge.role-sentinel   { background: rgba(80,160,255,.15);  color: #88ccff; border: 1px solid rgba(80,160,255,.3); }
.vlive-role-badge.role-initiator  { background: rgba(80,200,120,.15);  color: #88ffaa; border: 1px solid rgba(80,200,120,.3); }
.vlive-role-badge:not([class*="role-"]) { background: rgba(255,255,255,.05); color: var(--text-muted); border: 1px solid var(--border-dark); }

.vlive-level   { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }
.vlive-kda     { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--text-secondary); letter-spacing: .5px; }
.vlive-hs-pct  { font-size: 9px; color: var(--gold-1); }
.vlive-plants  { font-size: 9px; color: var(--valo-red); }
.vlive-defuses { font-size: 9px; color: var(--gold-1); }
.vlive-weapon  { font-size: 9px; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 78px; }

/* Badges positionnés sur l'icone */
.vlive-me-badge, .vlive-mvp-badge {
  position: absolute; font-size: 8px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #fff; padding: 1px 5px; border-radius: 3px;
}
.vlive-me-badge  { top: -5px; right: -5px; background: var(--valo-red); }
.vlive-mvp-badge { top: -5px; left: -5px;  background: var(--gold-1); color: #0f1923; }

/* Pregame agent cards (conservés) */
.vlive-agent-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; width: 80px; text-align: center;
}
.vlive-agent-card.is-me .vlive-agent-icon,
.vlive-agent-card.is-me .vlive-agent-noicon {
  border-color: var(--valo-red); box-shadow: 0 0 10px rgba(255,70,85,.4);
}
.vlive-agent-card.picking { opacity: .6; }
.vlive-agent-card.picking .vlive-agent-icon { filter: grayscale(.6); }
.vlive-agents-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; }
.vlive-agent-state { font-size: 9px; color: var(--text-muted); letter-spacing: .5px; }

/* Left panel — extras */
.s-red  { color: #ff7080; font-weight: 700; }
.s-blue { color: #6ab0ff; font-weight: 700; }
.vgi-kda    { font-family: var(--font-mono); letter-spacing: .5px; }
.vgi-hs     { color: var(--gold-1); }
.vgi-server { font-size: 11px; }
.vgi-rank   { font-weight: 700; color: var(--text-primary); }
.vgi-rr     { font-size: 11px; color: var(--text-muted); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 900px) {
  #valo-panel-left { width: 180px; }
  .vlive-player-card { width: 70px; }
}

@media (max-width: 700px) {
  #vtb { padding: 0 10px; gap: 6px; }
  .vtb-nav { display: none; }
  .vtb-right { gap: 5px; }
  .vtb-live-btn, #vtb-chat-btn { padding: 4px 10px !important; font-size: 11px !important; }

  body { overflow-y: auto; height: auto; }
  #valo-main { position: static; flex-direction: column; overflow: visible; height: auto; }
  #valo-panel-left { width: 100%; border-right: none; border-bottom: 1px solid rgba(255,70,85,.1); max-height: none; height: auto; overflow-y: visible; }
  #valo-panel-center { overflow: visible; flex: none; }
  #stream-wrap { width: 100%; height: calc(100vw * 9 / 16); }
  #stream-wrap iframe { width: 100%; height: 100%; border: none; display: block; }
  #valo-live-panel { padding: 10px; }

  .vlive-teams-grid { grid-template-columns: 1fr; }
  .vlive-agent-card  { width: 64px; }
  .vlive-player-card { width: 64px; }
  .vlive-agent-icon, .vlive-agent-noicon { width: 44px; height: 44px; }

  #valo-panel-right { display: none; }
  #valo-panel-right.open { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 300px; z-index: 50; border-top: 1px solid rgba(255,70,85,.2); }
}
