:root {
  color-scheme: light;
  --bg: #f3efe5;
  --panel: rgba(255, 251, 245, 0.84);
  --panel-border: rgba(70, 54, 38, 0.14);
  --ink: #1d1a18;
  --muted: #65594d;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --ghost: #7c3aed;
  --sim: #2563eb;
  --shadow: 0 20px 45px rgba(73, 55, 32, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(210, 179, 123, 0.35), transparent 34%),
    radial-gradient(circle at right 20%, rgba(15, 118, 110, 0.18), transparent 30%),
    linear-gradient(180deg, #efe6d4 0%, var(--bg) 46%, #efe9dd 100%);
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 24px auto 40px;
}

.hero {
  padding: 28px 30px;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255, 250, 243, 0.92), rgba(248, 242, 230, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 18px 0 12px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  max-width: 10ch;
}

.hero p {
  margin: 0;
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.6;
  font-size: 15px;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  margin-top: 18px;
}

.panel {
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.controls {
  padding: 20px;
}

.controls h2,
.stage h2 {
  margin: 0 0 14px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.control {
  margin-bottom: 16px;
}

.control label,
.legend h3,
.notes h3 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.note-list {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.toggle input {
  width: 18px;
  height: 18px;
}

.toggle-group {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
}

.toggle-group h3 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 8px;
}

.toggle-group .toggle {
  margin-top: 8px;
}

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-desc {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.4;
}

.toggle.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.legend,
.notes {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
}

.legend ul,
.notes ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: none;
}

.swatch-server {
  background: #0f766e;
}

.swatch-controller {
  background: #111827;
}

.swatch-ghost {
  background: #7c3aed;
}

.swatch-simulator {
  background: #2563eb;
}

.swatch-network {
  background: #d97706;
}

.stage {
  padding: 20px;
}

.view-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.view {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(220px, 0.9fr);
  gap: 14px 16px;
  align-items: start;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(98, 73, 49, 0.08);
  min-width: 0;
}

.view-title {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 0;
}

.view-title strong {
  font-size: 15px;
}

.view-title span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

canvas {
  width: 100%;
  aspect-ratio: 16 / 6;
  display: block;
  border-radius: 18px;
  border: 1px solid rgba(92, 71, 51, 0.11);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.92), rgba(241, 234, 223, 0.92));
}

.stats {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-self: stretch;
}

.stat {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.45;
}

.stat strong {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.footer-bar {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(28, 25, 23, 0.05);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

code {
  font-family: "SFMono-Regular", "Cascadia Code", monospace;
  font-size: 0.95em;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .view {
    grid-template-columns: 1fr;
  }
}
