:root {
  --bg: #0f1419;
  --panel: rgba(20, 26, 33, 0.92);
  --text: #e6e9ed;
  --muted: #8b96a3;
  --accent: #f28c28;
  --accent-text: #1a1206;
  --border: #2a3440;
  --ok: #4cc38a;
  --bad: #ef5b5b;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

#viewport {
  position: fixed;
  inset: 0;
}

#viewport canvas { display: block; touch-action: none; }

#panel {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 300px;
  max-height: calc(100% - 32px);
  overflow-y: auto;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(6px);
}

h1 { margin: 0; font-size: 22px; letter-spacing: 0.2px; }
.tagline { margin: 4px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.4; }

section { border-top: 1px solid var(--border); padding: 12px 0; }

label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.options label { display: inline-flex; align-items: center; gap: 6px; margin: 4px 12px 0 0; color: var(--text); }

.row { display: flex; gap: 8px; margin-top: 8px; }
.row select { flex: 1; }

select, button {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: #1b232c;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
}

select { width: 100%; }
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { flex: 1; background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }

#stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.stat span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat strong { font-variant-numeric: tabular-nums; font-size: 16px; }
#status { grid-column: 1 / -1; margin: 6px 0 0; font-size: 13px; color: var(--muted); min-height: 1.4em; }
#status.ok { color: var(--ok); }
#status.bad { color: var(--bad); }

footer { border-top: 1px solid var(--border); padding-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.45; }
footer p { margin: 4px 0; }
a { color: var(--accent); }

#tooltip {
  position: fixed;
  pointer-events: none;
  padding: 3px 8px;
  font-size: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
}

@media (max-width: 700px) {
  #panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: auto;
    max-height: 48%;
    border-radius: 12px 12px 0 0;
  }
  footer { display: none; }
}
