:root{
  --bg:#0b0f14;
  --panel:#101823;
  --panel-2:#0f1722;
  --text:#e7edf6;
  --muted:#9db0c6;
  --line:rgba(255,255,255,.08);
  --brand:#4aa3ff;
  --brand-2:#64f5d2;
  --warn:#ffcc66;
  --danger:#ff5b79;
  --shadow: 0 12px 40px rgba(0,0,0,.55);
  --radius: 14px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 800px at 20% -10%, rgba(74,163,255,.18), transparent 55%),
              radial-gradient(900px 700px at 85% 0%, rgba(100,245,210,.10), transparent 50%),
              var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height:1.55;
}

a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

.container{width:min(1100px, 92vw); margin:0 auto; padding:18px 0 48px;}

/* Topbar */
.topbar{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(10px);
  background: rgba(11,15,20,.72);
  border-bottom:1px solid var(--line);
}
.topbar-inner{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0;}
.brand{
  display:flex; align-items:center; gap:10px;
}
.brand-badge{
  width:34px;height:34px;border-radius:10px;
  background: linear-gradient(135deg, rgba(74,163,255,.95), rgba(100,245,210,.85));
  box-shadow: 0 10px 30px rgba(74,163,255,.18);
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}
.brand-badge img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}
.brand-title{font-weight:800; letter-spacing:.3px}
.brand-sub{color:var(--muted); font-size:12px; margin-top:2px}
.top-actions{display:flex; align-items:center; gap:10px}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border:1px solid var(--line);
  background: rgba(16,24,35,.72);
  color: var(--text);
  padding:10px 12px;
  border-radius: 12px;
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.btn:hover{transform: translateY(-1px); border-color: rgba(74,163,255,.35); background: rgba(16,24,35,.9);}
.btn:active{transform: translateY(0);}
.btn-primary{
  background: linear-gradient(135deg, rgba(74,163,255,.95), rgba(100,245,210,.75));
  border-color: rgba(255,255,255,.12);
  color: #081018;
  font-weight: 800;
}
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16,24,35,.55);
  color: var(--muted);
  font-size: 13px;
}
.dot{width:8px;height:8px;border-radius:50%; background: var(--muted); opacity:.75}
.dot.ok{background: var(--brand-2)}
.dot.warn{background: var(--warn)}
.dot.danger{background: var(--danger)}

/* Hero */
.hero{padding:26px 0 6px;}
.hero h1{margin:0; font-size: clamp(22px, 3.2vw, 34px); letter-spacing:.2px}
.hero p{margin:10px 0 0; color:var(--muted); max-width: 70ch}

/* Grid */
.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.card{
  grid-column: span 4;
  display:flex; gap:14px;
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16,24,35,.62);
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
  overflow:hidden;
  min-height: 130px;
}
.card:hover{border-color: rgba(74,163,255,.25)}
.card-cover{
  width: 180px; flex: 0 0 180px;
  background: rgba(0,0,0,.25);
}
.card-body{padding:14px 14px 14px 0; display:flex; flex-direction:column; gap:8px; min-width:0}
.card-title{font-weight:800; font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.card-meta{display:flex; flex-wrap:wrap; gap:8px; align-items:center; color:var(--muted); font-size:13px}
.tag{
  display:inline-flex; align-items:center;
  padding:5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15,23,34,.55);
  color: var(--muted);
}
.tag strong{color: var(--text); font-weight:800}
.card-brief{color:var(--muted); font-size:13px; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;}
.card-cta{margin-top:auto; display:flex; justify-content:flex-end; padding-right: 14px}

/* Player */
.player-wrap{margin-top: 18px; display:grid; grid-template-columns: 1fr 320px; gap:14px;}
.panel{
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16,24,35,.62);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.player{
  position:relative;
  background: #000;
  aspect-ratio: 16/9;
  width:100%;
}
.player video{
  width:100%; height:100%;
  display:block;
  background:#000;
}
.player-overlay{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  pointer-events:none;
}
.spinner{
  width:54px; height:54px;
  border-radius:50%;
  border: 3px solid rgba(255,255,255,.18);
  border-top-color: rgba(74,163,255,.9);
  animation: spin 1s linear infinite;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.45));
}
@keyframes spin{to{transform:rotate(360deg)}}

.player-toolbar{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 12px;
  border-top:1px solid var(--line);
  background: rgba(15,23,34,.72);
}
.toolbar-left{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.toolbar-right{display:flex; align-items:center; gap:10px}
.select{
  border:1px solid var(--line);
  background: rgba(16,24,35,.72);
  color: var(--text);
  padding:8px 10px;
  border-radius: 10px;
}
.hint{color:var(--muted); font-size: 13px}

.sidebar{padding: 14px;}
.sidebar h2{margin:0; font-size:16px;}
.sidebar .muted{color:var(--muted); font-size:13px; margin-top:8px}
.kv{margin-top:12px; display:grid; gap:8px}
.kv-row{display:flex; justify-content:space-between; gap:10px; font-size:13px; color:var(--muted)}
.kv-row strong{color:var(--text)}

/* Modal */
.modal-backdrop{
  position:fixed; inset:0; z-index:100;
  background: rgba(0,0,0,.62);
  display:none;
  align-items:center; justify-content:center;
  padding: 18px;
}
.modal{
  width: min(560px, 96vw);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: rgba(16,24,35,.92);
  box-shadow: 0 30px 120px rgba(0,0,0,.65);
  padding: 16px;
}
.modal h3{margin:0 0 8px; font-size:18px}
.modal p{margin:0; color:var(--muted)}
.modal-actions{display:flex; justify-content:flex-end; gap:10px; margin-top: 14px; flex-wrap:wrap}

/* Footer */
.footer{margin-top: 26px; color: var(--muted); font-size: 12px; border-top:1px solid var(--line); padding-top: 14px;}
.footer a{color: rgba(74,163,255,.9)}

/* Responsive */
@media (max-width: 980px){
  .card{grid-column: span 12;}
  .player-wrap{grid-template-columns: 1fr;}
}
@media (max-width: 1120px){
  .card{grid-column: span 6;}
}
@media (max-width: 540px){
  .card{flex-direction:column}
  .card-cover{width:100%; flex: 0 0 auto; aspect-ratio:16/9;}
  .card-body{padding: 12px}
  .card-cta{padding: 0}
  .topbar-inner{flex-direction:column; align-items:flex-start}
  .top-actions{width:100%; justify-content:space-between}
}

