* { box-sizing: border-box; }
:root {
  --bg: #0b0d12;
  --panel: #141821;
  --panel-2: #1b2130;
  --line: #262e40;
  --text: #e7ecf5;
  --muted: #93a0b8;
  --accent: #4f8cff;
  --accent-2: #22d3a6;
}
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 20% -10%, #17203a 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
.app { display: flex; flex-direction: column; min-height: 100%; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  background: rgba(11, 13, 18, .75); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.brand span { color: var(--muted); font-weight: 500; margin-left: 2px; }
.brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); }
.title { font-size: 15px; font-weight: 600; margin: 0; color: var(--text); }
.grow { flex: 1; }
.field { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
select, input[type=range] { accent-color: var(--accent); }
select {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-size: 14px; max-width: 260px;
}

.stage { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; padding: 18px; flex: 1; }
.player {
  position: relative; background: #000; border-radius: 14px; overflow: hidden;
  aspect-ratio: 16 / 9; border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.player video, .player .frame { width: 100%; height: 100%; display: block; background: #000; border: 0; }
.veil {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: 15px; background: rgba(0,0,0,.35); pointer-events: none;
}
.veil[hidden] { display: none; }
.bigplay {
  position: absolute; inset: 0; margin: auto; width: 92px; height: 92px; border-radius: 50%;
  border: 0; font-size: 34px; color: #fff; background: rgba(79,140,255,.9); cursor: pointer;
}
.bigplay[hidden] { display: none; }

.controls {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: linear-gradient(to top, rgba(0,0,0,.88), rgba(0,0,0,0));
  opacity: 0; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease;
}
.player.show-ui .controls, .player.paused .controls { opacity: 1; transform: none; }
.player.idle { cursor: none; }
.icon {
  border: 1px solid var(--line); background: rgba(20,24,33,.85); color: var(--text);
  width: 38px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 14px;
}
.icon:hover { border-color: var(--accent); }
.time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; min-width: 46px; text-align: center; }
.seek { flex: 1; height: 5px; border-radius: 4px; }
.vol { width: 92px; }

.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.side section { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.side h2 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.servers { display: flex; flex-direction: column; gap: 8px; }
.sgroup { display: flex; flex-direction: column; gap: 6px; }
.sgroup > b { font-size: 12px; color: var(--muted); font-weight: 600; }
.chip {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 8px 11px; cursor: pointer; font-size: 14px; text-align: left;
}
.chip:hover { border-color: var(--accent); }
.chip.on { border-color: var(--accent-2); box-shadow: inset 0 0 0 1px var(--accent-2); }
.chip small { color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: .6px; }
.eplist { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 7px; max-height: 320px; overflow: auto; }
.ep {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 7px 0; cursor: pointer; font-size: 13px;
}
.ep:hover { border-color: var(--accent); }
.ep.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.foot { padding: 8px 18px 16px; color: var(--muted); font-size: 12px; }

/* Modo iframe: manda el reproductor del servidor, asi que mis controles no
   aplican (el <video> propio queda oculto y el documento es de otro origen). */
.player.frame-mode .controls,
.player.frame-mode .bigplay { display: none; }
.player.frame-mode { background: #000; }

@media (max-width: 900px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .title { display: none; }
}
