:root {
  --bg: #0b0f17;
  --card: #121a26;
  --text: #e8eefc;
  --muted: #a7b3cc;
  --border: #223048;
  --accent: #5aa2ff;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px;
}

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

.header h1 {
  font-size: 20px;
  margin: 0;
}

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

.card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
}

.card h2 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.inputs-panel h2,
.videos-panel h2,
.vote-panel h2 {
  font-size: 18px;
}

.vote-panel {
  font-size: 15px;
}

.vote-panel label {
  font-size: 14px;
}

.vote-panel .vote-label {
  font-size: 15px;
}

.vote-panel .vote-hint {
  font-size: 14px;
}

.vote-panel button,
.vote-panel textarea,
.vote-panel .choice {
  font-size: 15px;
}

details summary {
  cursor: pointer;
  color: var(--muted);
}

details[open] summary {
  margin-bottom: 10px;
}

.manual-body {
  margin-top: 12px;
}

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

.grid > button {
  grid-column: 1 / -1;
}

.turnstile-wrap {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}

@media (min-width: 720px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

.triple-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 960px) {
  .triple-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

label.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: end;
}

label.checkbox input {
  width: auto;
  accent-color: var(--accent);
}

input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1622;
  color: var(--text);
}

textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1622;
  color: var(--text);
  font-family: inherit;
  resize: vertical;
}

button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1622;
  color: var(--text);
  cursor: pointer;
}

button:hover {
  border-color: #334a70;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #07101f;
  font-weight: 600;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.muted {
  color: var(--muted);
  margin: 8px 0 0 0;
  font-size: 13px;
}

.error {
  color: var(--danger);
  margin: 8px 0 0 0;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.seg-btn {
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
}

.mode-btn {
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
}

.seg-btn:last-child {
  border-right: none;
}

.mode-btn:last-child {
  border-right: none;
}

.seg-btn.active {
  background: #1a2a44;
}

.mode-btn.active {
  background: #1a2a44;
}

.inputs-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inputs-grid img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1622;
}

.video-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .video-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.video-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #0f1622;
}

.video-stage {
  position: relative;
}

.overlay-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 22, 34, 0.75);
  border: 1px solid var(--border);
  z-index: 5;
}

.overlay-btn .icon {
  width: 32px;
  height: 32px;
  fill: var(--text);
}

.video-vote-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .video-vote-grid {
    grid-template-columns: 1fr;
  }
}

.video-title {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.speed-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.speed-label {
  color: var(--muted);
  font-size: 13px;
}

.speed-btn {
  min-width: 42px;
  transition: background 0.15s, transform 0.15s;
}

.speed-btn.active {
  background: var(--accent);
  color: #fff;
  transform: scale(1.12);
  font-weight: 600;
}

video {
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #000;
}

.vote-form {
  display: grid;
  gap: 12px;
}

.rubric {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.vote-row {
  display: grid;
  gap: 8px;
}

.vote-label {
  color: var(--muted);
  font-size: 13px;
}

.vote-hint {
  color: var(--muted);
  opacity: 0.7;
  font-weight: 400;
}

.vote-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1622;
  cursor: pointer;
  user-select: none;
}

.choice input {
  width: auto;
}

.prose {
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

.prose h1,
.prose h2,
.prose h3 {
  margin: 20px 0 8px 0;
  font-size: 18px;
  color: var(--accent);
}

.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child {
  margin-top: 0;
}

.prose p {
  margin: 10px 0;
}

.prose ul {
  margin: 8px 0 8px 18px;
}

.prose strong {
  color: #fff;
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  margin: 14px 0;
  padding: 8px 14px;
  background: rgba(90, 162, 255, 0.06);
  border-radius: 0 8px 8px 0;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.examples {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.goal-setup {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: end;
}

@media (min-width: 720px) {
  .goal-setup {
    grid-template-columns: 1fr auto;
  }
}

.goal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.goal-bar {
  height: 10px;
  border-radius: 999px;
  background: #0f1622;
  border: 1px solid var(--border);
  overflow: hidden;
}

.goal-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 200ms ease;
}

.goal-complete {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.floating-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  background: #1a2a44;
}

.floating-panel {
  position: fixed;
  right: 18px;
  bottom: 70px;
  z-index: 21;
  width: min(420px, calc(100vw - 36px));
  border: 1px solid var(--border);
  background: rgba(18, 26, 38, 0.96);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.table {
  overflow-x: auto;
}

.table table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

/* Audit detail rows */
.audit-detail-row td {
  background: var(--surface);
  padding: 8px 12px;
}
.audit-games-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.audit-games-table th,
.audit-games-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.audit-games-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
}
.audit-games-table tr.excluded-game {
  opacity: 0.5;
}
.audit-edit-row td {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  padding: 8px 12px;
}
.audit-edit-row select {
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
}
.audit-review-row td {
  background: var(--surface);
  padding: 12px;
}
.audit-review-row .inputs-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.audit-review-row .inputs-grid img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.audit-video-stage .video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.audit-video-stage .video-card {
  position: relative;
}
.audit-video-stage .video-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--muted);
}
.audit-video-stage video {
  width: 100%;
  border-radius: 6px;
}
