:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101114;
  color: #f4f1ea;
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.stage {
  position: relative;
  min-height: calc(100vh - 36px);
  overflow: hidden;
  background: #050607;
  border: 1px solid #2c3036;
}

video,
#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#overlay {
  pointer-events: none;
}

.status {
  position: absolute;
  left: 16px;
  top: 16px;
  padding: 8px 10px;
  background: rgba(5, 6, 7, 0.72);
  border: 1px solid rgba(244, 241, 234, 0.18);
  font-size: 14px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  background: #191b20;
  border: 1px solid #30343c;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 760;
}

p {
  margin: 0;
  color: #bfc4c9;
  line-height: 1.45;
}

.meter {
  height: 14px;
  overflow: hidden;
  background: #2b3036;
  border: 1px solid #3c434b;
}

.meter > div {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #28c76f, #f4c542, #ff5d5d);
  transition: width 100ms linear;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
}

.stats div {
  padding: 12px;
  background: #111317;
  border: 1px solid #2b3036;
}

dt {
  margin-bottom: 6px;
  color: #9ea6ad;
  font-size: 12px;
  text-transform: uppercase;
}

dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: 20px;
}

.threshold {
  display: grid;
  gap: 10px;
  color: #d9dde1;
}

input[type="range"] {
  width: 100%;
  accent-color: #28c76f;
}

button {
  min-height: 44px;
  border: 0;
  color: #08100c;
  background: #65e39b;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.motion .status {
  color: #04110a;
  background: #b9ffd4;
  border-color: #65ffa6;
}

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

  .stage {
    min-height: 58vh;
  }

  .panel {
    min-height: auto;
  }
}
