*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a { color: var(--accent-ink); text-decoration: none; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-body);
  letter-spacing: -.02em;
  font-weight: 700;
}

img { max-width: 100%; }

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page {
  flex: 1;
  padding: 20px 18px calc(var(--nav-h) + 20px);
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.page-wide { max-width: 1100px; }

.topbar {
  min-height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 10px 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 8;
}

.topbar h1 { font-size: 1.15rem; font-weight: 700; }

.muted { color: var(--ink-2); }
.tiny { font-size: var(--text-xs); color: var(--ink-3); }
.info { color: var(--accent-ink); font-size: var(--text-sm); font-weight: 600; }

.score { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

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

@media (prefers-reduced-motion: reduce) {
  .btn:active, .act:active { transform: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
