/* Sorting Visualizer — plain CSS, no frameworks */

:root {
  --bg: #0f1115;
  --panel: #161a20;
  --text: #e4e7eb;
  --muted: #8b949e;
  --accent: #58a6ff;
  --border: #262b33;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

main { width: 100%; max-width: 940px; }

h1 { margin: 0 0 0.4rem; font-size: 1.5rem; }
header p { margin: 0 0 1.5rem; color: var(--muted); max-width: 60ch; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

select, input[type="range"] {
  accent-color: var(--accent);
}

select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
}

.buttons { display: flex; gap: 0.5rem; margin-left: auto; }

button {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #0b2239; font-weight: 600; }
button.primary:hover:not(:disabled) { filter: brightness(1.1); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.stats strong { color: var(--text); }
#statusText { margin-left: auto; }

canvas {
  width: 100%;
  height: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
}

footer {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.85rem;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .buttons { margin-left: 0; width: 100%; }
  .buttons button { flex: 1; }
}
