* { box-sizing: border-box; }
:root {
  --bg: #0b0f14;
  --panel: #111823;
  --text: #e5eef7;
  --muted: #93a1b3;
  --primary: #5b8cff;
  --danger: #e4546b;
  --border: #1f2a3a;
}
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Noto Sans, "Apple Color Emoji", "Segoe UI Emoji";
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: #0e141c; position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; letter-spacing: 0.3px; }
.auth button { margin-left: 8px; }

.layout { display: grid; grid-template-columns: 2fr 1.2fr; gap: 16px; padding: 16px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.panel h2 { margin: 0 0 12px 0; font-size: 16px; }

.player-wrap { aspect-ratio: 16/9; background: #0a0f16; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
video { width: 100%; height: 100%; background: black; display: block; }

.status { display: flex; gap: 16px; margin-top: 10px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.card { background: #0e1520; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; }
.card.selected { outline: 2px solid var(--primary); }
.card .thumb { aspect-ratio: 16 / 9; background: #101826; display: block; width: 100%; object-fit: cover; }
.card .content { padding: 8px; }
.card .title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.card .meta { color: var(--muted); font-size: 12px; }
.card.plus { display: grid; place-items: center; min-height: 160px; color: var(--muted); }

.actions { display: flex; gap: 10px; }
button { background: #152035; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
button.primary { background: var(--primary); border-color: transparent; color: white; }
button.secondary { background: #172235; }
button.danger { background: var(--danger); border-color: transparent; color: white; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.form { display: grid; gap: 10px; }
label { display: grid; gap: 6px; font-size: 14px; }
input[type="text"], textarea { background: #0b1220; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.row { display: flex; gap: 12px; align-items: center; }
.row-item { display: flex; gap: 6px; align-items: center; }
.thumb-preview { margin-top: 8px; }
.thumb-preview img { max-width: 100%; border: 1px solid var(--border); border-radius: 8px; }

.modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.6); }
.modal.hidden { display: none; }
.modal-content { width: min(640px, 92vw); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
}
