:root { --bg:#000; --fg:#eee; --dim:#bbb; --accent:#fff; }
html,body { background:var(--bg); color:var(--fg); font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; height:100%; }
body { margin:0; }
main { max-width:900px; margin:0 auto; padding:1rem; line-height:1.45; }
h1 { color:var(--accent); font-weight:600; font-size:1.1rem; margin:0 0 .4rem 0; letter-spacing:.02em; }
.hint { color:var(--dim); font-size:.95rem; margin:0 0 .75rem 0; }
.term {
  border:1px solid #2a2a2a; background:#0a0a0a; padding:.75rem; min-height:10rem;
  outline:none; white-space:pre-wrap; word-break:break-word; caret-color:var(--accent);
  box-shadow:0 0 0 1px #000 inset;
}
.panel { margin:.9rem 0 0 0; padding:.6rem; border:1px solid #2a2a2a; background:#0a0a0a; }
.controls.top { display:flex; gap:.6rem; align-items:center; flex-wrap:wrap; }
.grid { display:grid; grid-template-columns: 150px 1fr 70px; align-items:center; gap:.6rem .6rem; margin-top:.6rem; }
.row { display:contents; }
.val { text-align:right; color:var(--dim); font-variant-numeric: tabular-nums; }
select, button, input[type=range] {
  background:#111; color:var(--fg); border:1px solid #2a2a2a; padding:.4rem .6rem;
}
input[type=range] { width:100%; padding:0; }
button { cursor:pointer; }
*:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
/* layout for top controls (preset, speed, wobble, buttons) */
.controls.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* labels and values in the top controls */
.controls.top label.hint {
  font-size: 0.85rem;
  color: #999;
  margin-right: 0.25rem;
}

.controls.top input[type=range] {
  flex: 1 1 120px;    /* sliders grow but stay reasonable */
  min-width: 80px;
}

.controls.top span.val {
  min-width: 3rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #ccc;
}

/* buttons grouped nicely */
.controls.top button {
  background: #222;
  color: #eee;
  border: 1px solid #444;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.controls.top button:hover {
  background: #333;
}

.select-wrap {
  position: relative;
  display: inline-block;
}

.select-wrap select {
  background: #222;
  color: #eee;
  border: 1px solid #444;
  padding: 0.25rem 1.5rem 0.25rem 0.75rem; /* space for arrow */
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 0;
  line-height: 1.2;
}

.select-wrap::after {
  content: "▼";
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: #ccc;
  font-size: 0.6rem;
  pointer-events: none;
}

.select-wrap select:hover {
  background: #333;
}

/* shared range input */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 0.1rem;        /* thinner line */
  background: transparent;
  cursor: pointer;
}

/* WebKit track */
input[type=range]::-webkit-slider-runnable-track {
  height: 0.1rem;
  background: #555;      /* subtle grey line */
  border-radius: 2px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0.7rem;
  height: 0.7rem;
  background: #ccc;      /* lighter grey thumb */
  border: none;
  border-radius: 50%;
  margin-top: -0.25rem;  /* centers thumb on line */
}

/* Firefox track */
input[type=range]::-moz-range-track {
  height: 0.1rem;
  background: #555;
  border-radius: 2px;
}
input[type=range]::-moz-range-thumb {
  width: 0.7rem;
  height: 0.7rem;
  background: #ccc;
  border: none;
  border-radius: 50%;
}

/* Edge/IE */
input[type=range]::-ms-track {
  height: 0.1rem;
  background: transparent;
  border-color: transparent;
  color: transparent;
}
input[type=range]::-ms-fill-lower {
  background: #555;
}
input[type=range]::-ms-fill-upper {
  background: #555;
}
input[type=range]::-ms-thumb {
  width: 0.7rem;
  height: 0.7rem;
  background: #ccc;
  border: none;
  border-radius: 50%;
}
