:root {
  --rl-accent:      #e8670b;
  --rl-accent-dim:  rgba(232,103,11,.12);
  --rl-accent-glow: 0 0 18px rgba(232,103,11,.4);
  --rl-blue:        #4488ee;
  --rl-blue-light:  #6aadff;
  --rl-blue-dim:    rgba(68,136,238,.18);
  --rl-orange:      #dd6600;
  --rl-orange-light:#ffa040;
  --rl-orange-dim:  rgba(221,102,0,.18);
  --rl-boost:       #00e878;
}

/* ── TOPBAR ── */
#rltb {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 52px; display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  background: rgba(10,13,20,.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
.rltb-brand {
  font-family: var(--font-title); font-size: 18px; letter-spacing: 3px;
  color: var(--gold-1); text-decoration: none; flex-shrink: 0;
}
.rl-acc { color: var(--rl-accent); }
.rltb-nav { display: flex; gap: 2px; margin-left: 8px; }
.rltb-link {
  padding: 5px 14px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none; transition: all var(--t-base);
}
.rltb-link:hover { color: var(--rl-accent); }
.rltb-link.active { color: var(--rl-accent); background: var(--rl-accent-dim); }
.rltb-sep { width: 1px; height: 22px; background: var(--border-dark); flex-shrink: 0; }
.rltb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.rl-dot-status {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--text-muted);
}
.rl-dot-status.live    { background: var(--green-bright); box-shadow: 0 0 6px var(--green); animation: pulse 2s infinite; }
.rl-dot-status.loading { background: var(--rl-accent); animation: pulse 1.5s infinite; }
.rl-dot-status.off     { background: var(--text-muted); }

.rl-btn {
  border-color: var(--rl-accent) !important; color: var(--rl-accent) !important;
}
.rl-btn:hover { background: var(--rl-accent) !important; color: var(--bg-void) !important; box-shadow: var(--rl-accent-glow) !important; }
.rl-btn.active { background: var(--rl-accent) !important; color: var(--bg-void) !important; }

.rltb-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--rl-accent), transparent);
  opacity: .6;
}

/* ── SCORE BAR ── */
#rl-score-bar {
  position: fixed; top: 52px; left: 0; right: 0; z-index: 90;
  height: 52px; display: flex; align-items: stretch;
  background: rgba(2,3,10,.97); border-bottom: 1px solid var(--border-subtle);
}
#rl-score-bar.hidden { display: none; }
.rsb-team {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
}
.rsb-team.blue   { background: var(--rl-blue-dim); justify-content: flex-start; }
.rsb-team.orange { background: var(--rl-orange-dim); justify-content: flex-end; }
.rsb-sq { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }
.rsb-sq.blue   { background: var(--rl-blue-light); }
.rsb-sq.orange { background: var(--rl-orange-light); }
.rsb-lbl {
  font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-muted);
}
.rsb-score {
  font-family: var(--font-title); font-size: 36px; font-weight: 700;
  color: #fff; letter-spacing: 0; font-variant-numeric: tabular-nums;
  min-width: 28px; text-align: center;
  transition: color .25s;
}
.rsb-score.leading { color: var(--rl-boost); }
.rsb-center {
  width: 140px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); border-left: 1px solid var(--border-dark); border-right: 1px solid var(--border-dark);
}
#rsb-timer {
  font-family: var(--font-mono); font-size: 20px; font-weight: 700;
  color: rgba(255,255,255,.9); letter-spacing: 3px;
}
#rsb-timer.overtime { color: #ff4060; animation: blink .9s infinite; }
.rsb-badges { display: flex; gap: 4px; margin-top: 2px; min-height: 11px; }
.rsb-badge {
  font-size: 8px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 1px 5px; border-radius: 3px; line-height: 1.3;
}
.rsb-badge.hidden { display: none; }
.rsb-badge.ot     { color: #ff4060; background: rgba(255,64,96,.15); animation: blink .9s infinite; }
.rsb-badge.replay { color: #ffb020; background: rgba(255,176,32,.15); }
.rsb-badge.pause  { color: #9fb4cc; background: rgba(159,180,204,.15); }

/* ── LAYOUT ── */
#rl-main {
  position: fixed; top: 52px; left: 0; right: 0; bottom: 0;
  display: flex; overflow: hidden;
  transition: top .2s;
}
#rl-main.with-bar { top: 104px; }

/* ── LEFT PANEL ── */
#rl-panel-left {
  width: 280px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; overflow-x: hidden;
  padding: 12px 10px;
  background: var(--bg-dark); border-right: 1px solid var(--border-subtle);
}

@keyframes blink { 50% { opacity: .35; } }

/* ── PLAYER CARDS ── */
.rl-player-card {
  border-radius: var(--r-lg);
  background: var(--bg-surface); border: 1px solid var(--border-dark);
  overflow: hidden;
}
.rl-card-hdr {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 10px; border-bottom: 1px solid var(--border-dark);
}
.me-hdr { background: rgba(0,232,120,.06); border-top: 2px solid var(--rl-boost); }
.ally-hdr.blue   { background: var(--rl-blue-dim); border-top: 2px solid var(--rl-blue); }
.ally-hdr.orange { background: var(--rl-orange-dim); border-top: 2px solid var(--rl-orange); }
.me-tag {
  font-size: 8px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--rl-boost); padding-right: 7px; flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,.1);
}
.rl-dot-sm {
  width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
  background: var(--text-muted);
}
.rl-dot-sm.blue   { background: var(--rl-blue-light); }
.rl-dot-sm.orange { background: var(--rl-orange-light); }
.rl-player-name {
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  color: #fff; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rl-stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px 4px 4px; gap: 2px;
}
.rl-stat {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 2px;
}
.rl-stat-lbl {
  font-size: 8px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgba(255,255,255,.3);
}
.rl-stat-val {
  font-size: 26px; font-weight: 900; color: #fff; line-height: 1;
  transition: color .25s, transform .15s;
}
.rl-stat-val.bump { color: var(--rl-boost); transform: scale(1.3); }


/* Boost bar */
.boost-wrap {
  margin: 0 10px 8px; height: 3px;
  background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden;
}
.boost-bar {
  height: 100%; background: var(--rl-boost); border-radius: 2px;
  transition: width .4s ease;
}

/* ── ALLIES WRAP ── */
#rl-allies-wrap { display: flex; flex-direction: column; gap: 8px; }

/* ── CENTER PANEL ── */
#rl-panel-center {
  flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-void);
}
#rl-stream-wrap {
  flex: 1; min-height: 0; position: relative; overflow: hidden;
}
#rl-stream-wrap iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: none; display: block;
}
.stream-badge {
  position: absolute; bottom: 10px; left: 12px;
  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; letter-spacing: 1px; color: #fff;
  pointer-events: none;
}
.dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: #ff3355; box-shadow: 0 0 6px rgba(255,51,85,.8);
  animation: pulse 2s infinite;
}

/* ── EVENTS FEED ── */
#rl-events {
  flex-shrink: 0; height: 150px; display: flex; flex-direction: column;
  border-top: 1px solid var(--border-subtle); background: var(--bg-dark);
}
.rl-ev-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; border-bottom: 1px solid var(--border-dark);
}
.rl-ev-title {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-muted);
}
.rl-ev-mvp {
  font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  color: var(--gold-1); padding: 2px 8px; border: 1px solid var(--gold-3);
  border-radius: 10px; background: rgba(245,184,56,.12);
}
.rl-ev-mvp.hidden { display: none; }
#rl-ev-feed { flex: 1; overflow-y: auto; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.rl-ev-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 28px 18px; }
.rl-ev-empty-icon { font-size: 26px; opacity: .4; line-height: 1; animation: pulse 1.8s ease-in-out infinite; }
.rl-ev-empty-title { font-family: var(--font-title); font-weight: 600; font-size: var(--text-sm); color: var(--text-secondary); }
.rl-ev-empty-desc { font-size: var(--text-xs); color: var(--text-muted); line-height: 1.6; max-width: 260px; }
.rl-ev {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: var(--r-sm);
  background: var(--bg-surface); border-left: 3px solid var(--border-dark);
  font-size: 12px; animation: rl-ev-in .25s ease;
}
@keyframes rl-ev-in { from { opacity: 0; transform: translateX(-8px); } }
.rl-ev.goal        { background: rgba(0,232,120,.06); }
.rl-ev.goal.blue   { border-left-color: var(--rl-blue-light); }
.rl-ev.goal.orange { border-left-color: var(--rl-orange-light); }
.rl-ev.stat { border-left-color: var(--rl-boost); }
.rl-ev.ot   { border-left-color: #ff4060; background: rgba(255,64,96,.08); justify-content: center; }
.rl-ev-ico  { font-size: 14px; flex-shrink: 0; }
.rl-ev-main { flex: 1; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-ev-sub  { color: var(--text-muted); font-size: 10px; flex-shrink: 0; }

/* ── RIGHT PANEL — CHAT ── */
#rl-panel-right {
  width: 0; overflow: hidden; flex-shrink: 0;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--border-subtle);
  transition: width 250ms ease;
  background: var(--bg-dark);
}
#rl-panel-right.open { width: 300px; }
#rl-chat-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0;
}
.rl-chat-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-secondary);
}
.twitch-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #9147ff; box-shadow: 0 0 8px rgba(145,71,255,.6);
}
#rl-chat-body { flex: 1; overflow: hidden; }
#rl-chat-body iframe { width: 100%; height: 100%; border: none; }

/* ── WAITING STATE ── */
#rl-waiting {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; gap: 12px; color: var(--text-muted);
}
.rl-wait-icon { font-size: 40px; opacity: .15; }
.rl-wait-title { font-size: 16px; font-weight: 700; letter-spacing: 1px; color: var(--text-secondary); }
.rl-wait-sub   { font-size: 12px; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.25} }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  #rl-panel-left { width: 220px; }
  .rsb-center { width: 110px; }
  #rsb-timer { font-size: 16px; }
  .rsb-score { font-size: 28px; }
  .rsb-lbl { display: none; }
}
@media (max-width: 768px) {
  #rltb { padding: 0 10px; gap: 6px; }
  .rltb-brand { font-size: 15px; }
  .rltb-nav { display: none; }
  .rl-btn { padding: 4px 10px; font-size: 11px; }
  .rltb-right { gap: 5px; }

  #rl-score-bar { height: 44px; }
  .rsb-score { font-size: 24px; }
  .rsb-center { width: 90px; }
  #rsb-timer { font-size: 14px; letter-spacing: 2px; }

  #rl-main, #rl-main.with-bar { top: 96px; flex-direction: column; }
  #rl-main.with-bar { top: 140px; }
  #rl-panel-left {
    width: 100%; height: auto; flex-direction: row;
    overflow-x: auto; overflow-y: hidden;
    border-right: none; border-bottom: 1px solid var(--border-subtle);
    padding: 8px; gap: 8px;
  }
  #rl-me-card, .rl-player-card { min-width: 180px; flex-shrink: 0; }
  .rl-stat-val { font-size: 20px; }
  #rl-panel-center { flex: 1; }
  #rl-stream-wrap { min-height: 200px; }
  #rl-events { height: 110px; }
  #rl-panel-right.open { width: 100%; max-height: 250px; position: fixed; bottom: 0; left: 0; right: 0; height: 250px; }
}

