/* ═══════════════════════════════════════════════════════════════════════════
   Stream Hub — reskin Nocturne (structure + stream.js inchangés).
   Style les IDs/classes du markup ET ceux injectés par stream.js
   (game-bar .gb-*, calendrier .cal-*, multi .ms-*, more .mti-/.proxy-).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Topbar ── */
#stb {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 52px; display: flex; align-items: center; gap: var(--space-4);
  padding: 0 var(--space-8);
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
}
.stb-brand { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 18px; text-decoration: none; color: inherit; }
.hub-acc { color: var(--color-accent); }
.stb-tabs { display: inline-flex; border: 1px solid var(--color-divider); border-radius: var(--radius-md); overflow: hidden; }
.stb-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer;
  background: transparent; border: 0; color: var(--color-text);
}
.stb-tab + .stb-tab { border-left: 1px solid var(--color-divider); }
.stb-tab:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.stb-tab.active { color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.stb-tab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-neutral-600); }
.stb-tab-dot.live { background: var(--nc-live); box-shadow: 0 0 8px var(--nc-live); animation: pulse 1.6s infinite; }
.stb-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.stb-game-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 5px var(--space-3); border: 1px solid var(--color-divider); border-radius: 4px; }
.stb-game-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-neutral-600); }
.stb-game-dot.lol { background: var(--nc-live); box-shadow: 0 0 8px var(--nc-live); }
.stb-game-dot.valo { background: #ff4655; box-shadow: 0 0 8px #ff4655; }
.hub-btn {
  font: inherit; font-size: 13px; cursor: pointer;
  padding: 6px var(--space-3); border-radius: var(--radius-md);
  background: transparent; border: 1px solid var(--color-divider); color: var(--color-text);
}
.hub-btn:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.hub-btn.active { color: var(--color-accent); border-color: var(--color-accent); }
.stb-bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent); opacity: .5; }

/* ── Corps ── */
#hub-body { padding-top: 52px; min-height: 100vh; }
.hub-panel { animation: fadeUp .4s ease-out both; }

/* ── LIVE : player + chat ── */
#panel-live { display: flex; gap: var(--space-4); padding: var(--space-6) var(--space-8); }
#stream-area { flex: 1; min-width: 0; }
#stream-frame-wrap {
  position: relative; aspect-ratio: 16/9; width: 100%;
  background: var(--color-neutral-900); border-radius: var(--radius-md);
  border: 1px solid var(--color-divider); overflow: hidden;
}
#stream-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#stream-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-3); text-align: center;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}
.sph-icon { font-size: 34px; color: var(--color-accent); }
.sph-text { font-size: 13px; }

#game-bar { margin-top: var(--space-4); }
#game-bar-inner {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-md);
  font-size: 13px;
}
.gb-game-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.gb-game-tag.lol { background: var(--color-accent-800); color: var(--color-accent-100); }
.gb-game-tag.valo { background: rgba(255,70,85,.2); color: #ff8b95; }
.gb-champ { font-weight: 600; }
.gb-sep { width: 1px; height: 14px; background: var(--color-divider); }
.gb-stat { color: color-mix(in srgb, var(--color-text) 85%, transparent); }
.gb-score-a { color: var(--nc-live); font-weight: 600; }
.gb-score-b { color: var(--color-neutral-300); font-weight: 600; }

#chat-panel { width: 0; overflow: hidden; transition: width .25s ease; display: flex; flex-direction: column; }
#chat-panel.open { width: 340px; border: 1px solid var(--color-divider); border-radius: var(--radius-md); background: var(--color-surface); }
#chat-hdr { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3); border-bottom: 1px solid var(--color-divider); }
.chat-title { display: flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.twitch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); }
.chat-close { background: transparent; border: 0; color: var(--color-text); cursor: pointer; font-size: 14px; }
#chat-frame-wrap { flex: 1; min-height: 320px; }
#chat-frame-wrap iframe { width: 100%; height: 100%; border: 0; }

/* ── CALENDRIER ── */
#cal-wrap { max-width: 1100px; margin: 0 auto; padding: var(--space-6) var(--space-8); }
#cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
#cal-month-label { font-size: 20px; }
.cal-nav { background: transparent; border: 1px solid var(--color-divider); border-radius: var(--radius-md); width: 32px; height: 32px; cursor: pointer; color: var(--color-text); }
.cal-nav:hover { color: var(--color-accent); border-color: var(--color-accent); }
#cal-grid-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--space-2); margin-bottom: var(--space-2); }
#cal-grid-head > div { font-size: 11px; text-align: center; text-transform: uppercase; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
#cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--space-2); }
.cal-day {
  min-height: 78px; padding: var(--space-2); border-radius: var(--radius-sm);
  background: var(--color-surface); border: 1px solid transparent; display: flex; flex-direction: column; gap: 4px;
}
.cal-day.empty { background: transparent; }
.cal-day.today { border-color: var(--color-accent); }
.cal-day-num { font-size: 12px; color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.cal-dot-row { display: flex; gap: 3px; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-neutral-500); }
.cal-dot.lol { background: var(--nc-live); }
.cal-dot.valo { background: #ff4655; }
.cal-dot.general { background: var(--color-accent); }
.cal-dot.autre { background: var(--color-neutral-400); }
.cal-session-mini { font-size: 10px; color: color-mix(in srgb, var(--color-text) 75%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cal-upcoming { margin-top: var(--space-6); }
.cal-section-title { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--color-accent); margin-bottom: var(--space-3); }
.cal-upcoming-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent); font-size: 13px; }
.cui-date { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); min-width: 82px; }
.cui-title { flex: 1; }
.cui-time { color: var(--color-accent-300); font-size: 12px; }

/* ── MULTI STREAM ── */
#ms-toolbar { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; padding: var(--space-6) var(--space-8) 0; }
.ms-input { max-width: 280px; }
.ms-quick-btn { background: transparent; border: 1px solid var(--color-divider); border-radius: var(--radius-md); padding: 6px var(--space-3); font: inherit; font-size: 13px; color: var(--color-text); cursor: pointer; }
.ms-quick-btn:hover { color: var(--color-accent); border-color: var(--color-accent); }
#ms-grid { display: grid; gap: var(--space-4); padding: var(--space-6) var(--space-8); }
.ms-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); min-height: 240px; color: color-mix(in srgb, var(--color-text) 55%, transparent); background: var(--color-surface); border-radius: var(--radius-md); }
.ms-empty-icon { font-size: 28px; }
.ms-panel { display: flex; flex-direction: column; background: var(--color-surface); border: 1px solid var(--color-divider); border-radius: var(--radius-md); overflow: hidden; }
.ms-panel-hdr { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-divider); }
.ms-channel-name { font-weight: 600; font-size: 13px; }
.ms-panel-btns { display: flex; gap: 6px; }
.ms-btn { background: transparent; border: 1px solid var(--color-divider); border-radius: var(--radius-sm); cursor: pointer; padding: 2px 6px; color: var(--color-text); }
.ms-btn.ms-sound-on { border-color: var(--color-accent); }
.ms-frame-wrap { position: relative; aspect-ratio: 16/9; background: var(--color-neutral-900); }
.ms-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── MORE ── */
#more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); max-width: 680px; padding: var(--space-6) var(--space-8); }
.more-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); background: var(--color-surface); border-radius: var(--radius-md); }
.more-card-title { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 15px; margin-bottom: var(--space-2); }
.mti-row, .more-proxy-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); font-size: 13px; }
.more-proxy-row { justify-content: flex-start; }
.mti-label { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.mti-val { color: var(--color-text); }
.mti-val.hub-acc { color: var(--color-accent); }
.more-ext-links { display: flex; gap: var(--space-3); margin-top: var(--space-2); }
.more-ext { font-size: 12px; }
.proxy-dot { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; background: var(--color-neutral-600); }
.proxy-dot.ok { background: var(--nc-live); box-shadow: 0 0 6px var(--nc-live); }
.proxy-dot.stale { background: var(--color-neutral-400); }
.proxy-dot.off { background: #ff4655; }

/* ── Responsive ── */
@media (max-width: 900px) {
  #panel-live { flex-direction: column; }
  #chat-panel.open { width: 100%; }
  #more-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  #stb { padding: 0 var(--space-4); gap: var(--space-2); }
  .stb-tab { padding: 7px 9px; font-size: 12px; }
  #panel-live, #ms-toolbar, #ms-grid, #more-grid, #cal-wrap { padding-left: var(--space-4); padding-right: var(--space-4); }
}
