:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #666666;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --fg: #f2f2f2;
    --muted: #9a9a9a;
  }
}

html[data-theme="dark"] {
  --bg: #111111;
  --fg: #f2f2f2;
  --muted: #9a9a9a;
}

html[data-theme="light"] {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #666666;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  box-sizing: border-box;
  text-align: center;
}

#title {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#big {
  font-size: clamp(56px, 20vw, 112px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

#info {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

#note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

#note:empty {
  display: none;
}

#stop {
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 10px 28px;
  min-height: 44px;
  border: 2px solid var(--fg);
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

#stop:hover {
  background: var(--fg);
  color: var(--bg);
}

#stop:disabled {
  opacity: 0.4;
  cursor: default;
}

[data-state="loading"] #title,
[data-state="loading"] #stop,
[data-state="empty"] #title,
[data-state="empty"] #stop,
[data-state="done"] #stop,
[data-state="error"] #title {
  display: none;
}

[data-state="empty"] #big {
  font-size: 32px;
  font-weight: 600;
}

[data-state="empty"] #info {
  white-space: pre-line;
}

[data-state="error"] #info {
  font-size: 14px;
}
