.panel {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header {
  min-height: 76px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 254 248 / 86%);
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.icon-button,
.square-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.icon-button:hover,
.square-button:hover {
  border-color: var(--ink);
  background: var(--surface-raised);
  transform: translateY(-1px);
}

.icon-button {
  font-family: var(--font-mono);
  font-weight: 700;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.01em;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.primary-button {
  min-width: 144px;
  color: white;
  background: var(--ink);
}

.primary-button:hover {
  background: #2d3b36;
  transform: translateY(-1px);
}

.secondary-button {
  flex: 1;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-raised);
}

.secondary-button:hover {
  border-color: var(--ink);
  background: white;
}

.pause-glyph {
  display: flex;
  gap: 3px;
}

.pause-glyph i {
  display: block;
  width: 2px;
  height: 10px;
  border-radius: 2px;
  background: currentColor;
}

.primary-button.is-paused .pause-glyph {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

.primary-button.is-paused .pause-glyph i {
  display: none;
}

.step-glyph {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
}

.step-glyph::after {
  position: absolute;
  width: 2px;
  height: 11px;
  margin-top: -5.5px;
  margin-left: 2px;
  background: currentColor;
  content: "";
}

.reset-glyph {
  font-size: 21px;
  line-height: 1;
}

.button-row {
  display: flex;
  gap: 8px;
}

.field-label,
.range-field {
  display: block;
  margin-top: 18px;
}

.field-label > span,
.range-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 750;
}

.field-label small,
.range-field small {
  display: block;
  margin-top: 8px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.45;
}

.field-label select {
  width: 100%;
  min-height: 44px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--surface-raised);
  font-size: 12px;
  font-weight: 700;
}

.range-field output,
.speed-control output {
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ink), var(--line));
}

input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ink), var(--line));
}

input[type="range"]::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  margin-top: -6px;
  appearance: none;
  border: 3px solid var(--surface-raised);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--ink);
}

input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 3px solid var(--surface-raised);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--ink);
}

.about-dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 34px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--surface-raised);
  box-shadow: 0 30px 100px rgb(7 19 17 / 35%);
}

.about-dialog::backdrop {
  background: rgb(7 19 17 / 58%);
  backdrop-filter: blur(4px);
}

.about-dialog h2 {
  max-width: 330px;
  margin: 8px 0 20px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.about-dialog p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--paper);
  font-size: 20px;
}

.dialog-key {
  display: flex;
  gap: 18px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dialog-key span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dialog-key i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.key-cell { background: var(--culture); }
.key-food { background: var(--food); }
.key-link { border: 1px solid var(--culture); }
.key-rare { border: 2px solid #fff45c; background: #ff2bd6; box-shadow: 0 0 7px #fff45c; transform: rotate(45deg); }
