:root { --accent: #ff4444; }

body {
  min-height: 100vh;
  padding: clamp(16px, 3vw, 40px) clamp(12px, 2vw, 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
}
#loader {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 40vh;
}
.spinner {
  width: clamp(32px, 4vw, 52px);
  height: clamp(32px, 4vw, 52px);
  border: 3px solid #2a2a2a;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.title-wrap { width: min(95vw, 1400px); }
.step-label {
  font-size: clamp(11px, 1vw, 14px);
  color: var(--text-faint);
  margin-bottom: 8px;
  text-align: center;
}
.current-title {
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: clamp(12px, 1.5vw, 20px) clamp(14px, 2vw, 24px);
  font-size: clamp(14px, 1.4vw, 22px);
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}
.thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.2vw, 18px);
  width: min(95vw, 1400px);
}
@media (max-width: 600px) { .thumbnails-grid { grid-template-columns: 1fr; } }
.thumb-zone {
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border-strong);
  cursor: pointer;
}
.thumb-zone.clickable:hover { border-color: var(--accent); }
.thumb-zone.assigned { border-color: var(--border-hover); cursor: default; }
.thumb-zone img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.thumb-label {
  min-height: clamp(32px, 3vw, 48px);
  padding: clamp(6px, 0.8vw, 10px);
  font-size: clamp(12px, 0.9vw, 14px);
  color: var(--text-faint-2);
  text-align: center;
  line-height: 1.3;
}
.thumb-zone.assigned .thumb-label { color: #bbb; font-weight: 600; }
@media (max-width: 600px) {
  body { gap: 12px; padding: 12px; }
  .step-label { font-size: 13px; color: var(--text-muted); }
  .current-title { font-size: 15px; padding: 14px 16px; }
  .thumb-label { font-size: 13px; min-height: 44px; padding: 10px 8px; }
  .thumb-zone.clickable:active { border-color: var(--accent); }
}
.error-box {
  background: var(--panel);
  border: 2px solid var(--bad);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: center;
  max-width: 600px;
}
.error-box a { color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.2vw, 18px);
  width: min(95vw, 1400px);
}
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.card:hover { border-color: var(--border-hover); }
.card.correct { border-color: var(--good); }
.card.wrong   { border-color: var(--bad); }
.badge {
  position: absolute;
  top: 8px; left: 8px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge.ok   { background: var(--good); color: #000; }
.badge.fail { background: var(--bad); color: #fff; }
.card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.card-info { padding: clamp(8px, 0.8vw, 12px); }
.card-info .row { display: flex; align-items: flex-start; gap: 8px; font-size: clamp(12px, 0.9vw, 14px); margin-bottom: 5px; }
.card-info .row:last-child { margin-bottom: 0; }
.row-label {
  flex-shrink: 0;
  font-size: clamp(10px, 0.7vw, 11px);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  padding-top: 1px;
  width: 52px;
}
.row-text { line-height: 1.4; }
.row-text img.emoji { height: 1em; width: 1em; vertical-align: -0.15em; display: inline; }
.row-text.correct-t { color: var(--good); font-weight: 600; }
.row-text.wrong-t   { color: var(--bad); text-decoration: line-through; }
@media (max-width: 600px) {
  .card-info { padding: 10px; }
  .card-info .row { font-size: 13px; gap: 6px; }
  .row-label { font-size: 10px; width: 58px; }
  .actions { gap: 10px; }
  .actions a { padding: 14px; font-size: 15px; }
}
.actions { display: flex; gap: 12px; width: min(95vw, 480px); }
.actions a {
  flex: 1;
  text-align: center;
  padding: 13px;
  border-radius: var(--radius);
  font-size: clamp(13px, 1.2vw, 17px);
  font-weight: 600;
  text-decoration: none;
}
.actions a:hover { opacity: 0.8; }
.btn-red  { background: var(--accent); color: #fff; }
.btn-dark { background: var(--border); color: #fff; }
