/* ──────────────────────────────────────────────────────────────────────
   Wolf Pack Evolution Simulator — page styles
   Scoped to .wolfsim so it lives cleanly inside the site's base layout.
   ────────────────────────────────────────────────────────────────────── */

.wolfsim {
  --bg:           #0f1117;
  --surface:      #1a1f2e;
  --surface-2:    #222840;
  --border:       rgba(255,255,255,0.08);
  --w-text:       #e2e8f0;
  --w-muted:      #94a3b8;
  --wolf:         #86efac;
  --rabbit:       #fde68a;
  --deer:         #93c5fd;
  --bear:         #fb923c;
  --speed:        #c4b5fd;
  --perc:         #f9a8d4;
  --w-radius:     10px;

  background: var(--bg);
  color: var(--w-text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding: 1.5rem 1rem 3rem;
}

/* ── Header ────────────────────────────────────────────────────────── */
.wolfsim .sim-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.wolfsim .sim-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--w-text);
}

.wolfsim .subtitle {
  font-size: 0.85rem;
  color: var(--w-muted);
  margin-top: 0.25rem;
}

/* ── Layout ────────────────────────────────────────────────────────── */
.wolfsim #wrap {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  max-width: 980px;
  margin: 0 auto;
}

.wolfsim .canvas-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ── Canvas ────────────────────────────────────────────────────────── */
.wolfsim canvas {
  display: block;
  width: 100%;
  border-radius: var(--w-radius);
  border: 1px solid var(--border);
  background: #111827;
}

/* ── Legend ────────────────────────────────────────────────────────── */
.wolfsim .legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.wolfsim .leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--w-muted);
}

.wolfsim .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.wolfsim .dot.wolf   { background: var(--wolf); }
.wolfsim .dot.rabbit { background: var(--rabbit); }
.wolfsim .dot.deer   { background: var(--deer); }
.wolfsim .dot.bear   { background: var(--bear); }

/* ── Panel ─────────────────────────────────────────────────────────── */
.wolfsim #panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wolfsim .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--w-radius);
  padding: 12px 14px;
}

.wolfsim .card-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--w-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.wolfsim .big-num {
  font-size: 28px;
  font-weight: 600;
  color: var(--w-text);
  line-height: 1;
}

.wolfsim .sub {
  font-size: 11px;
  color: var(--w-muted);
  margin-top: 2px;
}

/* ── Stats ─────────────────────────────────────────────────────────── */
.wolfsim .stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
}

.wolfsim .stat-label { font-size: 12px; color: var(--w-muted); }
.wolfsim .stat-val   { font-size: 12px; font-weight: 500; color: var(--w-text); }

/* ── Gene bars ─────────────────────────────────────────────────────── */
.wolfsim .gene-row { margin-bottom: 6px; }

.wolfsim .gene-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--w-muted);
  margin-bottom: 3px;
}

.wolfsim .gene-bg {
  height: 5px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.wolfsim .gene-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s ease;
}

.wolfsim .wolf-fill   { background: var(--wolf); }
.wolfsim .deer-fill   { background: var(--deer); }
.wolfsim .rabbit-fill { background: var(--rabbit); }
.wolfsim .bear-fill   { background: var(--bear); }
.wolfsim .speed-fill  { background: var(--speed); }
.wolfsim .perc-fill   { background: var(--perc); }

/* ── Controls ──────────────────────────────────────────────────────── */
.wolfsim .btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.wolfsim button {
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--w-text);
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.wolfsim button:hover { background: var(--surface-2); }
.wolfsim button:active { opacity: 0.8; }

.wolfsim .slider-row { margin-top: 4px; }

.wolfsim input[type="range"] {
  width: 100%;
  margin-top: 4px;
  accent-color: var(--wolf);
}

/* ── Log ───────────────────────────────────────────────────────────── */
.wolfsim .log-card { flex: 1; min-height: 0; }

.wolfsim #log {
  font-size: 10px;
  font-family: 'Courier New', monospace;
  color: var(--w-muted);
  line-height: 1.7;
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.wolfsim #log::-webkit-scrollbar { width: 4px; }
.wolfsim #log::-webkit-scrollbar-track { background: transparent; }
.wolfsim #log::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .wolfsim #wrap { grid-template-columns: 1fr; }
}
