:root {
  --bg: #111318;
  --panel: #1b1f27;
  --text: #f4f6fb;
  --muted: #9aa3b2;
  --accent: #2ecc71;
  --warn: #ff4d4d;
  --ring: #d7dae0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  user-select: none;
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.5rem max(1.5rem, env(safe-area-inset-bottom));
}

.brand {
  font-size: 1rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
}

.limit-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
}

.limit-sign {
  width: min(72vw, 340px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  border: clamp(10px, 3.2vw, 18px) solid var(--warn);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #101010;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.limit-sign.changed {
  animation: pop 0.6s ease;
}

.limit-sign.unknown {
  background: var(--panel);
  border-color: #3a4150;
  color: var(--muted);
}

.limit {
  font-size: clamp(5rem, 26vw, 11rem);
  font-weight: 800;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.unit {
  font-size: clamp(0.9rem, 3.5vw, 1.2rem);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #4a4a4a;
}

.change {
  min-height: 2.2rem;
  font-size: clamp(1.05rem, 4.5vw, 1.5rem);
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.change.show {
  opacity: 1;
  transform: translateY(0);
}

.toggle {
  width: 100%;
  max-width: 420px;
  padding: 1.15rem 1.5rem;
  font-size: 1.3rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #06240f;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.toggle:active { filter: brightness(0.9); }

.toggle.stop {
  background: var(--warn);
  color: #2a0505;
}

.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.fix {
  margin: 0;
  min-height: 1.2rem;
  color: #66707f;
  font-size: 0.8rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@keyframes pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); box-shadow: 0 0 0 18px rgba(46, 204, 113, 0.35); }
  100% { transform: scale(1); }
}
