:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #10131a;
  --surface-strong: #171b25;
  --text: #ffffff;
  --secondary: #dbe7f4;
  --muted: #aab5c4;
  --cyan: #9be7ff;
  --violet: #c5a8ff;
  --mint: #9df7ce;
  --amber: #ffc178;
  --focus: #b9f3ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 600px;
  height: 600px;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app-root {
  width: 600px;
  height: 600px;
  padding: 18px 20px 20px;
  overflow: hidden;
}

.stage {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  grid-template-rows: 68px 1fr 82px;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 0;
  max-width: 390px;
  color: var(--text);
  font-size: 28px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 0;
}

.formula {
  min-width: 82px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 0 28px rgba(155, 231, 255, 0.12);
}

.orb-field {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 398px;
  mix-blend-mode: plus-lighter;
}

#orb-canvas {
  width: 496px;
  height: 496px;
}

.center-readout {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.28);
  transform: translateY(34px);
}

.phase {
  color: var(--secondary);
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
}

.seconds {
  margin-top: 1px;
  color: var(--text);
  font-size: 70px;
  line-height: 0.96;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
}

.microcopy {
  margin-top: 7px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.mode-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-items: end;
  padding: 10px 16px 0;
}

.mode-button {
  height: 68px;
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  opacity: 0.82;
  transition:
    transform 475ms cubic-bezier(0.6, 0, 0.4, 1),
    opacity 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
    border-color 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
    background 300ms cubic-bezier(0.4, 0.04, 0.5, 1);
}

.mode-button span,
.mode-button small {
  display: block;
}

.mode-button span {
  font-size: 17px;
  line-height: 1.1;
  font-weight: 800;
}

.mode-button small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mode-button:focus,
.mode-button.active {
  outline: none;
  opacity: 1;
  transform: scale(0.94);
  border-color: rgba(185, 243, 255, 0.88);
  background: var(--surface-strong);
  box-shadow:
    0 0 0 2px rgba(185, 243, 255, 0.16),
    0 0 34px rgba(155, 231, 255, 0.18);
}

.mode-button.active small {
  color: var(--secondary);
}

@media (prefers-reduced-motion: reduce) {
  .mode-button {
    transition: none;
  }
}
