/* ════════════════════════════════════════════════════════════════
   ECS from Scratch · Tutorial-specific styles
   Builds on tutorial.css design tokens.
   ════════════════════════════════════════════════════════════════ */

/* ── History timeline (same shape as graph-tutorial.css;
      duplicated so this tutorial does not need to load those stylesheets) ─ */
.sort-timeline {
  margin: 1.75rem 0 2.25rem;
  border-left: 1px solid var(--tut-border);
  padding-left: 1.25rem;
}

.sort-timeline-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.25rem;
  padding: 0.55rem 0;
  align-items: baseline;
}

.sort-timeline-year {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--tut-accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  position: relative;
}

.sort-timeline-year::before {
  content: '';
  position: absolute;
  left: -1.95rem;
  top: 0.4em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tut-accent);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.sort-timeline-body {
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--tut-soft);
}

.sort-timeline-body strong { color: var(--tut-text); font-weight: 600; }

/* ── Code blocks ─────────────────────────────────────────────────── */
pre.code code {
  font-family: inherit;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  white-space: pre;
  display: block;
}

/* ── Card visual on the home index for this tutorial ─────────────── */
.tut-card-visual.ecs-bg,
.game-card-visual.ecs-bg {
  background:
    radial-gradient(circle at 30% 35%, rgba(96, 165, 250, 0.30), transparent 45%),
    radial-gradient(circle at 70% 60%, rgba(52, 211, 153, 0.25), transparent 45%),
    linear-gradient(135deg, #0a0f1f 0%, #0d0a1a 50%, #0a1a16 100%);
}

/* ── Archetype table widget ──────────────────────────────────────── */
.arch-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.arch-controls .btn {
  font-size: 0.72rem;
  padding: 0.4rem 0.75rem;
}

/* ── Sparse set widget highlight colors ──────────────────────────── */
.sparse-highlight { color: var(--tut-warn); }
.dense-highlight  { color: var(--tut-success); }

/* ── Generational index widget ───────────────────────────────────── */
.gen-log {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--tut-soft);
  max-height: 140px;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
  background: var(--tut-bg);
  border: 1px solid var(--tut-border-soft);
  border-radius: 6px;
}

.gen-log .ok   { color: var(--tut-success); }
.gen-log .fail { color: var(--tut-danger); }
.gen-log .info { color: var(--tut-muted); }

/* ── Query matcher widget ────────────────────────────────────────── */
.query-builder {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.query-builder label {
  color: var(--tut-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.query-builder select {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--tut-surface);
  color: var(--tut-text);
  border: 1px solid var(--tut-border);
  padding: 0.35rem 0.55rem;
  border-radius: 5px;
}

.query-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
}

.query-tag.with    { background: rgba(52, 211, 153, 0.15); color: var(--tut-success); border: 1px solid rgba(52, 211, 153, 0.3); }
.query-tag.without { background: rgba(248, 113, 113, 0.12); color: var(--tut-danger); border: 1px solid rgba(248, 113, 113, 0.3); }

/* ── OOP vs ECS iteration comparison ─────────────────────────────── */
.iter-legend {
  display: flex;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--tut-muted);
}

.iter-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.iter-legend .swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
