/* CS:GO Human Evals — clean dark editorial */

:root {
  color-scheme: dark;

  --bg: #0c0e13;
  --bg-deep: #08090d;
  --surface: #14181f;
  --surface-2: #1a1f28;
  --surface-3: #20262f;
  --surface-4: #272d37;
  --line: #232831;
  --line-soft: #1a1e25;
  --line-bright: #2f3540;

  --text: #e8ebef;
  --text-soft: #b3bac5;
  --text-mute: #8a92a0;
  --text-faint: #555c6a;

  --accent: #ed9b5d;
  --accent-hot: #f5b07d;
  --accent-glow: rgba(237, 155, 93, 0.14);
  --good: #4dd97a;
  --bad: #ff6b78;

  --body: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

  --r: 6px;
  --r-tight: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1200px 700px at 80% -20%, rgba(237, 155, 93, 0.04), transparent 70%),
    var(--bg);
  min-height: 100vh;
}

.hidden { display: none !important; }

button, select, textarea, input { font: inherit; }

button {
  font-family: var(--body);
  font-weight: 600;
  cursor: pointer;
  border: 0;
  background: var(--accent);
  color: #0a0c10;
  padding: 11px 16px;
  border-radius: var(--r);
  font-size: 14px;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--line);
  font-weight: 500;
}

.ghost:hover:not(:disabled) {
  border-color: var(--line-bright);
  color: var(--text);
  background: var(--surface-2);
}

.small {
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 500;
}

/* ---------- type primitives ---------- */

h1, h2, h3, p { margin: 0; }

.kicker {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-mute);
  margin: 0 0 14px;
  letter-spacing: 0.005em;
}

.muted {
  color: var(--text-mute);
  font-size: 13px;
  line-height: 1.55;
}

.muted.mono,
.mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-soft);
}

.small-note {
  font-size: 12.5px;
  color: var(--text-mute);
  line-height: 1.55;
  margin: 0;
}

/* ---------- welcome ---------- */

.welcome {
  position: relative;
  min-height: 100vh;
  padding: 56px 32px 80px;
}

.welcome-inner {
  position: relative;
  width: min(1200px, 100%);
  margin: 0 auto;
}

.welcome-hero {
  display: block;
  max-width: 720px;
  margin: 0 0 40px;
}

.hero-title {
  font-family: var(--body);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 18px;
}

.lead {
  color: var(--text-soft);
  font-size: 15.5px;
  line-height: 1.65;
  margin: 0 0 14px;
  font-weight: 400;
}

.hero-facts {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.5;
}

.hero-facts li {
  position: relative;
  padding-left: 18px;
}

.hero-facts li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 1px;
  background: var(--accent);
}

.hero-facts strong {
  color: var(--text);
  font-weight: 600;
}

.issue-examples {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.45;
}

.issue-examples li {
  position: relative;
  padding-left: 20px;
}

.issue-examples li::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 0.62em;
  width: 9px;
  height: 9px;
  border: 1px solid var(--accent);
  border-radius: 50%;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--text-soft);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--line-soft);
}

.prize-line {
  color: var(--text-mute);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 18px 0 24px;
}

.cta-primary {
  background: var(--accent);
  color: #0a0c10;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--r);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
}

.cta-primary:hover:not(:disabled) {
  background: var(--accent-hot);
}

.cta-compact {
  width: auto;
  padding: 11px 16px;
}

/* ---------- examples + leaderboard row ---------- */

.welcome-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.examples article {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color 0.16s ease;
}

.examples article:hover { border-color: var(--line-bright); }

.examples header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.examples h2 {
  font-family: var(--body);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0;
}

.sample-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}

.sample-tag.clean {
  background: rgba(77, 219, 122, 0.10);
  color: var(--good);
  border: 1px solid rgba(77, 219, 122, 0.28);
}

.sample-tag.broken {
  background: rgba(255, 107, 120, 0.10);
  color: var(--bad);
  border: 1px solid rgba(255, 107, 120, 0.30);
}

.examples video {
  width: 100%;
  aspect-ratio: 2 / 3;
  max-height: 580px;
  background: #02040a;
  border-radius: var(--r-tight);
  border: 1px solid var(--line-soft);
  object-fit: contain;
  display: block;
}

.examples p {
  color: var(--text-mute);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.missing-example video { display: none; }

.missing-example::after {
  content: 'Example clip not configured.';
  display: grid;
  place-items: center;
  min-height: 320px;
  aspect-ratio: 2 / 3;
  color: var(--text-mute);
  background: #02040a;
  border: 1px dashed var(--line);
  border-radius: var(--r-tight);
  font-size: 13px;
}

/* ---------- welcome leaderboard ---------- */

.board {
  display: grid;
  gap: 10px;
  padding: 18px 20px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.board > h2 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0 0 4px;
}

/* ---------- shell ---------- */

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 100vh;
}

.review-pane {
  padding: 28px 32px 80px;
  min-width: 0;
}

.side-pane {
  border-left: 1px solid var(--line);
  background: var(--bg-deep);
  padding: 28px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- topbar ---------- */

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.topbar-meta h1 {
  font-family: var(--body);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.reviewer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

.reviewer-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-mute);
}

.reviewer-name {
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- review layout ---------- */

.review-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 380px;
  gap: 22px;
  align-items: start;
}

.video-wrap {
  position: relative;
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  width: min(760px, 100%);
  justify-self: center;
  aspect-ratio: 2 / 3;
  min-height: 620px;
}

.video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #02040a;
  font-size: 13px;
  color: var(--text-mute);
}

/* ---------- toolbox cards ---------- */

.toolbox {
  display: grid;
  gap: 14px;
}

.cell-card,
.actions-card,
.focus-card,
.score-card,
.board-card,
.meta-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.section-head h2,
.meta-card h2 {
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.005em;
}

.cell-card .small-note { margin-bottom: 12px; }

/* ---------- cells ---------- */

.cell-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(5, auto);
  grid-auto-flow: column;
  gap: 8px;
}

.cell {
  position: relative;
  background: var(--surface-2);
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-tight);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  text-align: left;
  aspect-ratio: 2.4;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.cell:hover:not(:disabled) {
  border-color: var(--line-bright);
  background: var(--surface-3);
  color: var(--text);
}

.cell.selected {
  background: rgba(237, 155, 93, 0.10);
  border-color: var(--accent);
  color: var(--text);
}

.cell-key {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r-tight);
  background: var(--surface);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mute);
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.cell.selected .cell-key {
  background: var(--accent);
  color: #0a0c10;
  border-color: var(--accent);
}

.cell-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- issue card ---------- */

.issue-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--r);
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mute);
}

select, textarea, input {
  width: 100%;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-tight);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.14s ease, background 0.14s ease;
}

select:focus, textarea:focus, input:focus {
  border-color: var(--accent);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a92a0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

textarea {
  resize: vertical;
  font-weight: 400;
  line-height: 1.5;
  min-height: 64px;
}

/* ---------- pass / flag ---------- */

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pass, .flag {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 14px 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--r);
}

.pass {
  background: var(--good);
  color: #052113;
  border: 1px solid var(--good);
}

.pass:hover:not(:disabled) {
  background: #5fe28e;
}

.flag {
  background: var(--accent);
  color: #0a0c10;
  border: 1px solid var(--accent);
}

.flag:hover:not(:disabled) {
  background: var(--accent-hot);
}

.btn-key {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 12px;
}

.pass .btn-key {
  color: rgba(5, 33, 19, 0.78);
  background: rgba(5, 33, 19, 0.16);
  border: 1px solid rgba(5, 33, 19, 0.24);
}

.flag .btn-key {
  color: rgba(10, 12, 16, 0.78);
  background: rgba(10, 12, 16, 0.16);
  border: 1px solid rgba(10, 12, 16, 0.24);
}

.skip-btn {
  margin-top: 10px;
  width: 100%;
  font-size: 13px;
  padding: 9px;
  font-weight: 500;
}

/* ---------- focus card ---------- */

.focus-card {
  display: grid;
  gap: 10px;
}

.focus-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #02040a;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-tight);
  display: block;
}

/* ---------- side pane: score ---------- */

.score-card {
  display: grid;
  gap: 12px;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.score {
  display: grid;
  gap: 4px;
  padding: 6px 14px 6px 0;
}

.score:first-child {
  border-right: 1px solid var(--line-soft);
}

.score:last-child {
  padding-left: 14px;
  padding-right: 0;
}

.score span {
  font-family: var(--body);
  font-weight: 800;
  font-size: 36px;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}

.score:last-child span { color: var(--accent); }

.score small {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-mute);
}

.status-pill {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  padding: 8px 12px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-tight);
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
}

/* ---------- side pane: board ---------- */

.board-card {
  display: grid;
  gap: 10px;
}

.board-card > h2 {
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

/* ---------- side pane: meta ---------- */

.meta-card {
  display: grid;
  gap: 12px;
}

.meta {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px 12px;
  margin: 0;
}

.meta dt {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-mute);
  padding-top: 1px;
}

.meta dd {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.meta dd.mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-soft);
}

/* ---------- leaderboard ---------- */

.leaderboard {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: leaderboard;
}

.leaderboard-head {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 56px 56px;
  gap: 10px;
  padding: 4px 0 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-mute);
  border-bottom: 1px solid var(--line-soft);
}

.leaderboard-head::before { content: '#'; }

.leaderboard-head span:nth-child(2),
.leaderboard-head span:nth-child(3) { text-align: right; }

.leaderboard li {
  counter-increment: leaderboard;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 56px 56px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.leaderboard li:last-child { border-bottom: 0; }

.leaderboard li::before {
  content: counter(leaderboard);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
}

.leaderboard li:nth-child(1)::before { color: var(--accent); }

.leaderboard .empty-row { counter-increment: none; opacity: 0.7; }
.leaderboard .empty-row::before { content: '–'; color: var(--text-faint); }

.leaderboard .name {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard .count {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
  text-align: right;
}

.leaderboard .flag-count {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- dialog ---------- */

dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0;
  width: min(440px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgba(2, 4, 8, 0.72);
  backdrop-filter: blur(4px);
}

#nameForm {
  padding: 28px 26px 22px;
}

#nameForm h2 {
  font-family: var(--body);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.dialog-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-mute);
  margin: 0 0 20px;
}

.dialog-field { margin-bottom: 12px; }

.dialog-field label {
  margin-bottom: 6px;
}

.dialog-field .optional {
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 400;
  margin-left: 4px;
}

#nameForm menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0;
  margin: 18px 0 0;
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .shell { grid-template-columns: 1fr; }
  .side-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .welcome-grid { grid-template-columns: 1fr; }
  .welcome-hero { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .review-layout { grid-template-columns: 1fr; }
  .video-wrap { min-height: 460px; }
  .examples { grid-template-columns: 1fr; }
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .reviewer { align-self: flex-start; }
}

@media (max-width: 640px) {
  .welcome { padding: 32px 16px 60px; }
  .review-pane,
  .side-pane { padding: 20px 16px 60px; }
  .actions { grid-template-columns: 1fr; }
  .score span { font-size: 32px; }
  .topbar-meta h1 { font-size: 20px; }
  .hero-title { font-size: clamp(26px, 7vw, 34px); }
}
