:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #161616;
  background: #f3f3f1;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.topbar,
.hero,
.status-card,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar {
  margin-bottom: 56px;
}

.topbar h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: .18em;
}

.eyebrow,
.label {
  display: block;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  font-weight: 700;
  opacity: .55;
}

.hero {
  align-items: flex-end;
  margin-bottom: 28px;
}

.hero h2 {
  margin: 6px 0 8px;
  max-width: 700px;
  font-size: clamp(34px, 6vw, 66px);
  line-height: .95;
  letter-spacing: -.05em;
}

.muted {
  max-width: 620px;
  color: #656565;
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 17px;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.primary {
  background: #111;
  color: #fff;
}

.secondary {
  background: #fff;
  color: #111;
  border: 1px solid #deded8;
}

.text-button {
  padding: 8px 0;
  background: transparent;
  color: #555;
}

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: #e6e6e1;
  font-size: 13px;
  font-weight: 700;
}

.badge.connected {
  background: #dff4df;
}

.status-card,
.panel {
  background: #fff;
  border: 1px solid #e5e5df;
  border-radius: 22px;
}

.status-card {
  padding: 20px 22px;
}

.status-card strong {
  display: block;
  margin-top: 5px;
}

.attempt-box {
  text-align: right;
}

.stimulus {
  min-height: 280px;
  margin: 16px 0;
  border-radius: 26px;
  display: grid;
  place-items: center;
  background: #171717;
  color: #fff;
  font-size: clamp(42px, 10vw, 100px);
  font-weight: 900;
  letter-spacing: -.05em;
  transition: background .12s ease, transform .12s ease;
}

.stimulus.waiting {
  background: #242424;
}

.stimulus.go {
  background: #1d8a43;
  transform: scale(1.004);
}

.stimulus.false {
  background: #b73030;
}

.stimulus.finished {
  background: #e7e7e2;
  color: #171717;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.metrics article {
  padding: 20px;
  background: #fff;
  border: 1px solid #e5e5df;
  border-radius: 18px;
}

.metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 27px;
}

.panel {
  padding: 22px;
  margin-top: 16px;
}

.panel h3 {
  margin: 4px 0 0;
}

.empty {
  padding: 36px 0 18px;
  color: #777;
}

.results {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.result {
  padding: 16px;
  border-radius: 16px;
  background: #f4f4f1;
}

.result span {
  display: block;
  font-size: 12px;
  color: #777;
  margin-bottom: 6px;
}

.result strong {
  font-size: 22px;
}

.log-panel pre {
  margin: 20px 0 0;
  max-height: 240px;
  overflow: auto;
  padding: 16px;
  background: #151515;
  color: #ececec;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .topbar {
    margin-bottom: 34px;
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .results {
    grid-template-columns: repeat(2, 1fr);
  }

  .stimulus {
    min-height: 220px;
  }
}
