/* Match the site's typeface (Routed Gothic; single weight, bold synthesised). */
@font-face {
  font-family: 'Routed Gothic';
  src: url('/assets/fonts/RoutedGothic-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #000000;
  --line: #d6d6d6;
  --muted: #6f6f6f;
  --panel-bg: rgba(255, 255, 255, 0.94);
  --accent: #b03a2e; /* Chinese seal vermilion */
}

html.theme-dark {
  color-scheme: dark;
  --bg: #0d0d0d;
  --fg: #f0f0f0;
  --line: #2a2a2a;
  --muted: #8b8b8b;
  --panel-bg: rgba(18, 18, 20, 0.94);
  --accent: #e74c3c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Routed Gothic', 'iA Writer Quattro', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  user-select: none;
}

canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  touch-action: none;
  cursor: crosshair;
}

#panel {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  width: 228px;
  padding: 12px 14px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11px;
  line-height: 1.35;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.title {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.seal-tag {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--accent);
  padding: 1px 3px;
  border-radius: 2px;
  line-height: 1;
}

.control {
  display: block;
  margin-bottom: 8px;
}

.lab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lab .val {
  font-weight: 700;
}

select {
  font: inherit;
  font-size: 11px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 3px 5px;
  width: 100%;
  cursor: pointer;
  border-radius: 0;
  margin-top: 2px;
  outline: none;
}

select:focus {
  border-color: var(--fg);
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 12px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}

input[type=range]::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--line);
}

input[type=range]::-moz-range-track {
  height: 1px;
  background: var(--line);
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -5px;
  background: var(--fg);
  border-radius: 50%;
}

input[type=range]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  background: var(--fg);
  border: none;
  border-radius: 50%;
}

.toggles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  margin: 9px 0 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10.5px;
}

.toggle input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--fg);
  cursor: pointer;
}

.btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 8px;
}

.btn-group.triple {
  grid-template-columns: 1fr 1fr 1fr;
}

button {
  font: inherit;
  font-size: 10.5px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 4px 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: border-color .15s linear, background-color .15s linear;
  line-height: 1.2;
  text-align: center;
}

button:hover {
  border-color: var(--fg);
}

button:active {
  background: var(--line);
}

.meta {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.status-msg {
  color: var(--fg);
  font-weight: 700;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hint {
  font-size: 9.5px;
  line-height: 1.4;
  margin-top: 4px;
}
