/* Shared tokens, typography and building blocks for every page. */

:root {
  --bg: #fff7ea;
  --bg-accent: #ffe9c7;
  --surface: #ffffff;
  --ink: #2b2a33;
  --ink-soft: #5e5b6b;
  --line: #eadfcb;
  --brand: #ff8a3d;
  --brand-deep: #d9661d;
  --brand-ink: #ffffff;
  --sky: #3ba7ff;
  --sky-deep: #1f7fd0;
  --good: #2fb36d;
  --good-deep: #1f8a50;
  --bad: #e5484d;
  --star: #ffc531;
  --focus: #3ba7ff;
  --shadow-soft: 0 10px 30px rgba(90, 60, 20, 0.1);
  --radius: 22px;

  /* The chalkboard stays dark in both themes, like a real classroom board. */
  --board: #1f3a33;
  --board-deep: #162c26;
  --board-wood: #a8743f;
  --board-wood-deep: #7d522a;
  --chalk: #f4f1e8;
  --chalk-soft: #b9c7bf;
  --c-tens: #6fd0ff;
  --c-ones: #ffbe55;
  --c-take: #ff86b1;
  --c-result: #86e893;
  --c-tag: #ffe08a;

  --font-ui: "Baloo 2", "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-chalk: "Patrick Hand", "Mali", "Comic Sans MS", cursive;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151827;
    --bg-accent: #1d2236;
    --surface: #20243a;
    --ink: #f2f0f7;
    --ink-soft: #b3b0c4;
    --line: #33385a;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 18px;
  line-height: 1.5;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Chunky "pressable" buttons that young kids can hit easily. */
.btn {
  --btn-bg: var(--surface);
  --btn-edge: var(--line);
  --btn-ink: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: 52px;
  padding: 0.35em 1.1em;
  border: 2px solid var(--btn-edge);
  border-radius: 16px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--btn-edge);
  transition: transform 90ms ease, box-shadow 90ms ease, background 150ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  filter: brightness(1.04);
}

.btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--btn-edge);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  --btn-bg: var(--brand);
  --btn-edge: var(--brand-deep);
  --btn-ink: var(--brand-ink);
}

.btn-sky {
  --btn-bg: var(--sky);
  --btn-edge: var(--sky-deep);
  --btn-ink: #fff;
}

.btn-good {
  --btn-bg: var(--good);
  --btn-edge: var(--good-deep);
  --btn-ink: #fff;
}

.btn-icon {
  width: 52px;
  padding: 0;
}

.btn svg {
  width: 24px;
  height: 24px;
  flex: none;
}

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 16px 48px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.1;
}

.brand img {
  width: 44px;
  height: 44px;
}

.brand small {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.stars {
  display: inline-flex;
  gap: 2px;
}

.star {
  width: 22px;
  height: 22px;
  color: var(--line);
}

.star.is-on {
  color: var(--star);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
