/* Simple, clean styles for the visualizer */
:root {
  --bg: #0d1117;
  --card: #161b22;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --good: #2ea043;
  --warn: #d29922;
  --bad: #f85149;
  --grid: rgba(255,255,255,0.06);
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji;
  background: radial-gradient(1200px 800px at 70% -20%, #1f2430, var(--bg));
  color: var(--text);
}

header {
  padding: 1.2rem 1rem;
  border-bottom: 1px solid var(--grid);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}
h1 { margin: 0 0 .25rem; font-size: clamp(1.4rem, 1.2rem + 1.2vw, 2rem); }
.tagline { margin:0; color: var(--muted); }

.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1rem;
  padding: 1rem;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--grid);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

h2, h3 { margin-top: 0.6rem; }

.row {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin: .5rem 0;
}

.buttons.inline button + button { margin-left: .25rem; }

button {
  background: #1f6feb;
  color: white;
  border: none;
  padding: .5rem .75rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
button:hover { filter: brightness(1.08); }
button:disabled { background: #2e3c56; cursor: not-allowed; }
button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

label { color: var(--muted); }

input[type="number"], input[type="text"] {
  width: 80px;
  padding: .4rem .45rem;
  background: #0b1320;
  color: var(--text);
  border: 1px solid var(--grid);
  border-radius: 8px;
}
input[type="range"] { width: 200px; }
select {
  background: #0b1320;
  color: var(--text);
  border: 1px solid var(--grid);
  border-radius: 8px;
  padding: .4rem .5rem;
}

.matrix-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 360px;
}
.matrix-table th, .matrix-table td {
  border: 1px dashed var(--grid);
  padding: .25rem;
  text-align: center;
}
.matrix-table input[type="number"] {
  width: 90px;
}

.scroll-x {
  overflow-x: auto;
  padding-bottom: .4rem;
}

.notes { color: var(--muted); }

/* Viz */
.viz svg {
  width: 100%;
  height: clamp(280px, 40vw, 600px);
  background: radial-gradient(600px 400px at 20% -10%, rgba(255,255,255,0.04), transparent);
  border: 1px dashed var(--grid);
  border-radius: 12px;
}
.legend {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  color: var(--muted);
  margin: .5rem 0 1rem;
}
.legend-box {
  display:inline-block; width: 14px; height: 14px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(88,166,255,.2), rgba(46,160,67,.6));
  margin-right: .25rem;
  vertical-align: -2px;
}
.legend-line {
  display:inline-block; height: 0; border-top: 3px solid var(--accent); width: 32px;
  margin-right: .25rem; vertical-align: 3px;
}

#analysis {
  margin-top: .5rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #0b1320; border: 1px solid var(--grid); padding: .5rem .7rem; border-radius: 8px;
  white-space: pre-wrap;
}

footer {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
}
footer a { color: var(--accent); }

.noscript {
  margin: 1rem;
  background: #3b1d1d;
  color: #ffd7d7;
  border: 1px solid #7a2f2f;
  padding: .75rem 1rem;
  border-radius: 8px;
}
