/* Styles specific to the Level 2 demos. Shared demo chrome is in ../demos.css */

.controls {
  display: flex; flex-wrap: wrap; gap: .5rem;
  justify-content: center; margin-top: .9rem;
}

.btn {
  padding: .55rem 1rem; min-height: 40px;
  font-size: .88rem; font-weight: 650;
  border: 1px solid var(--accent); border-radius: 99px;
  background: transparent; color: var(--accent);
  cursor: pointer;
}
.btn:hover { background: var(--accent-soft); }
.btn.solid { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn:disabled { opacity: .4; cursor: default; }

@media (prefers-color-scheme: dark) { .btn.solid { color: #14201a; } }
@media (pointer: coarse) { .btn { min-height: 44px; } }

.hint { font-size: .8rem; color: var(--muted); text-align: center; margin: .6rem 0 0; }

.readout {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .82rem; color: var(--muted);
  text-align: center; margin-top: .5rem; min-height: 1.2em;
}

/* 3 — pathfinding grid */
.grid-wrap { display: flex; flex-direction: column; align-items: center; }
#maze { image-rendering: pixelated; cursor: crosshair; }

/* 5 — SVG line art */
.draw-svg { width: 190px; height: 190px; }
.draw-svg path, .draw-svg circle {
  fill: none; stroke: var(--accent); stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
}
.draw-svg .ink {
  stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
  animation: draw 3.4s ease-in-out infinite;
}
@keyframes draw {
  0%       { stroke-dashoffset: var(--len); }
  45%, 65% { stroke-dashoffset: 0; }
  100%     { stroke-dashoffset: calc(var(--len) * -1); }
}

/* 8 — virtual scroll */
.vscroll {
  width: 100%; max-width: 330px; height: 200px;
  overflow-y: auto; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg);
  position: relative;
}
.vscroll-inner { position: relative; }
.vrow {
  position: absolute; left: 0; right: 0; height: 32px;
  display: flex; align-items: center; gap: .6rem;
  padding: 0 .8rem; font-size: .85rem;
  border-bottom: 1px solid var(--line);
  box-sizing: border-box;
}
.vrow b { color: var(--accent); font-variant-numeric: tabular-nums; }

/* 9 — pixel editor */
.pixel-grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  gap: 2px; width: 100%; max-width: 264px;
  touch-action: none;
}
.px {
  aspect-ratio: 1; border-radius: 3px;
  background: var(--line); cursor: pointer;
}
.px.on { background: var(--accent); }

/* 10 — particle text */
#ptext { cursor: pointer; }
