:root {
  --bg: #0f0f10;
  --surface: #1a1a1c;
  --surface-hover: #232326;
  --border: #2a2a2e;
  --text: #f5f5f7;
  --text-muted: #8a8a90;
  --accent: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 520px;
}

.canvas-wrap {
  position: relative;
  width: 400px;
  height: 400px;
  border-radius: 24px;
  background: radial-gradient(
    circle at 50% 40%,
    #1a1a1c 0%,
    #0f0f10 70%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#rive-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 0.02em;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.status.hidden {
  opacity: 0;
}

.status.error {
  color: #ff7a7a;
  padding: 0 24px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pill {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease,
    transform 160ms ease;
  user-select: none;
}

.pill:hover {
  background: var(--surface-hover);
  border-color: #3a3a3e;
}

.pill:active {
  transform: scale(0.97);
}

.pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pill[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 440px) {
  .canvas-wrap {
    width: 320px;
    height: 320px;
  }
}
