/* Look borrowed from the CS2 panel (cs2-panel-bridge), copied rather than
   shared so the two projects stay independent. */
:root {
  color-scheme: dark;
  --bg: #0c0d14;
  --panel: #161826;
  --ring: #292b31;
  --field: #232532;
  --line: rgba(233, 233, 237, .08);
  --border: rgba(233, 233, 237, .16);
  --text: #e9e9ed;
  --soft: #cfd3e5;
  --muted: #75798c;
  --accent: #9184d9;
  --accent-bg: rgba(145, 132, 217, .14);
  --accent-border: #5d5294;
  --accent-text: #d2cefd;
  --green: #7ee0a3;
  --red: #e07e7e;
  --yellow: #e0c97e;
  --k3: #7eb6e0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 'Inter', system-ui, sans-serif;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px;
  max-width: 1100px; margin: 0 auto; padding: 14px 16px; background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(126, 224, 163, .18); flex-shrink: 0; }
.brand-name { font-size: 15px; font-weight: 500; line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--muted); }
.me { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--soft); flex-wrap: wrap; }
.me .who-me { display: flex; align-items: center; gap: 8px; }
.me img { width: 26px; height: 26px; border-radius: 6px; }
.me form { margin: 0; }
.nav-link { color: var(--soft); }
.nav-link.active { color: var(--accent-text); }
.vline { width: 1px; height: 22px; background: var(--border); }

/* Controls */
button, select {
  font: 500 13px 'Inter', sans-serif;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
}
select { background: var(--field); }
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent-bg); border-color: var(--accent-border); color: var(--accent-text); }
button.link { border: 0; background: none; color: var(--muted); padding: 0; }
button.link:hover { color: var(--text); }

main { max-width: 1100px; margin: 0 auto; padding: 4px 16px 40px; }

.card { background: var(--panel); border-radius: 14px; box-shadow: 0 0 0 1px var(--ring); padding: 16px; margin-bottom: 18px; }
.label, h2 {
  font-size: 11px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 12px;
}
h1 { font-size: 22px; font-weight: 600; margin: 0 0 8px; }

/* Sign-in / messages */
.hero { max-width: 380px; margin: 60px auto; text-align: center; }
.hero h1 { font-size: 20px; }
.hero p { color: var(--muted); margin: 0 0 22px; font-size: 13.5px; }
.hero .error { color: var(--red); }
.provider {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border-radius: 9px;
  font-weight: 600; font-size: 14px; border: 1px solid transparent;
}
.provider:hover { text-decoration: none; }
.provider.steam { background: #171a21; border-color: #2a475e; color: #c7d5e0; }
.provider.steam:hover { background: #1b2838; }
.provider svg { width: 20px; height: 20px; }

/* Stats */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--panel); border-radius: 14px; box-shadow: 0 0 0 1px var(--ring); padding: 14px 16px; }
.tile b { display: block; font-size: 24px; font-weight: 600; }
.tile span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Render settings + worker status */
.render { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.render .settings { display: flex; align-items: center; gap: 8px; margin: 0; }
.render .settings label { font-size: 13px; color: var(--soft); display: flex; align-items: center; gap: 8px; }
.render .worker { margin: 0; color: var(--muted); font-size: 12px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 400; padding: 4px 12px 8px 0; color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td small { color: var(--muted); }
td form { margin: 0; }
td button { padding: 4px 10px; font-size: 12px; }
td button.failed { border-color: #5c3a3a; color: var(--red); }

.badge {
  display: inline-block; min-width: 38px; text-align: center; padding: 2px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 600; background: #3f424d; color: #f3f5fe;
}
.k3 .badge { background: rgba(126, 182, 224, .18); color: var(--k3); }
.k4 .badge { background: rgba(145, 132, 217, .2); color: var(--accent-text); }
.k5 .badge { background: rgba(224, 126, 126, .2); color: var(--red); }

.cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
button.force { background: var(--accent-bg); border-color: var(--accent-border); color: var(--accent-text); }
.status { color: var(--muted); font-size: 12px; }
.status.busy { color: var(--yellow); }
.play { color: var(--green); font-weight: 600; white-space: nowrap; }

.empty { color: var(--muted); margin: 0; }

/* Videos */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.vcard {
  display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 10px;
  color: var(--text); background: var(--field); border: 1px solid rgba(233, 233, 237, .12);
}
.vcard:hover { border-color: var(--accent); text-decoration: none; }
.vcard .badge { align-self: flex-start; }
.vcard small { color: var(--muted); }
video { width: 100%; border-radius: 10px; background: #000; }
.meta, .downloads { color: var(--muted); font-size: 13px; }

/* Users (admin) and teammates */
.count {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #000;
  font-size: 11px; font-weight: 700; text-align: center;
}
.who { display: flex; align-items: center; gap: 8px; }
.who img { width: 24px; height: 24px; border-radius: 5px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.actions form { margin: 0; }
button.approve { border-color: #1f4d2e; color: var(--green); }
button.refuse { border-color: #5c3a3a; color: var(--red); }
.pill { font-size: 10.5px; padding: 2px 8px; border-radius: 5px; background: #3f424d; }
.pill.pending { background: #4d451f; color: var(--yellow); }
.pill.approved { background: #1f4d2e; color: var(--green); }
.pill.refused { background: #4d1f1f; color: var(--red); }
tr.refused td { opacity: .6; }

@media (max-width: 700px) {
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  td { border: 0; padding: 2px 0; }
}

/* Video cards with the keep toggle */
.vcard > a { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.vcard > a:hover { text-decoration: none; }
.vfoot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; }
.vfoot small { font-size: 11px; }
form.keep { margin: 0; display: inline; }
form.keep button { padding: 3px 9px; font-size: 12px; }
form.keep button.kept { border-color: #4d451f; color: var(--yellow); }
.downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
