:root { --bg: rgb(244,245,248); --card: rgb(255,255,255); --line: rgb(200,202,212); --text: rgb(24,24,30); --muted: rgb(88,90,104); --brand: rgb(0,99,204); --good: rgb(21,128,61); --bad: rgb(185,28,28) }
@media (prefers-color-scheme: dark) {
  :root { --bg: rgb(16,16,20); --card: rgb(27,27,34); --line: rgb(52,52,63); --text: rgb(236,236,242); --muted: rgb(160,160,174); --brand: rgb(77,166,255); --good: rgb(48,209,88); --bad: rgb(255,105,97) }
}
* { box-sizing: border-box; margin: 0; padding: 0 }
body { background: var(--bg); color: var(--text); font: 1rem/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; -webkit-text-size-adjust: 100%;
  padding: calc(env(safe-area-inset-top) + 1rem) calc(env(safe-area-inset-right) + 1rem) calc(env(safe-area-inset-bottom) + 1rem) calc(env(safe-area-inset-left) + 1rem) }
main { max-width: 36rem; margin: 0 auto; display: flex; flex-direction: column; gap: .75rem }
h1 { font-size: 1.4rem }
h2 { font-size: 1rem; margin-top: .5rem }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem }
.muted { color: var(--muted); font-size: .875rem }
.good { color: var(--good) }
.bad { color: var(--bad) }
button { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: .875rem; padding: .75rem 1rem; min-height: 3rem; width: 100%; text-align: left; touch-action: manipulation; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer }
button b { display: block }
button.main { background: rgb(0,99,204); border-color: rgb(0,99,204); color: white; text-align: center; font-weight: 600 }
button:disabled { opacity: .55; cursor: default }
button.picked { border: 2px solid var(--brand) }
button.right { border: 2px solid var(--good); color: var(--good); font-weight: 600; opacity: 1 }
button.wrong { border: 2px solid var(--bad); color: var(--bad); font-weight: 600; opacity: 1 }
button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px }
.row { display: flex; gap: .75rem; justify-content: space-between; align-items: center }
.clock { font-size: 1.75rem; font-variant-numeric: tabular-nums; white-space: nowrap }
.stack { display: flex; flex-direction: column; gap: .5rem }
.question { font-size: 1.15rem; white-space: pre-wrap; overflow-wrap: anywhere }

/* The seasons (season.js sets the colours): a tinted page, a drifting picture and the challenges. */
.season { --brand: var(--sk); --ink: white; --bg: var(--l2) }
.season body { background: linear-gradient(170deg, var(--l1), var(--l2)) fixed; min-height: 100vh }
@media (prefers-color-scheme: dark) {
  .season { --brand: var(--sa); --ink: rgb(11,16,32); --bg: var(--d1) }
  .season body { background: linear-gradient(170deg, var(--d1), var(--d2)) fixed }
}
.season button.main { background: var(--brand); border-color: var(--brand); color: var(--ink) }
#sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; color: var(--brand) }
#sky[hidden] { display: none }
#sky i { position: absolute; top: 0; bottom: 0; animation: fall linear infinite }
#sky svg { position: absolute; opacity: .35 }
#sky.rise i { animation-name: rise }
@keyframes fall { from { transform: translateY(-100%) } to { transform: translateY(100%) } }
@keyframes rise { from { transform: translateY(100%) } to { transform: translateY(-100%) } }
/* Emblems and badges are glossy rounded tiles, as on macOS. */
.emblem { width: 2.25rem; height: 2.25rem; padding: .4rem; box-sizing: border-box; flex: none; border-radius: 24%; color: #fff;
  background: linear-gradient(rgba(255,255,255,.36),rgba(255,255,255,0) 52%), linear-gradient(160deg, var(--sa), var(--sk));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 3px rgba(0,0,0,.35) }
.title { display: flex; align-items: center; gap: .5rem }
.season-card { display: flex; flex-direction: column; gap: .875rem; border-color: var(--brand) }
.season-head { display: flex; align-items: center; gap: .75rem }
.season-head h2 { margin: 0 }
.goal { display: flex; align-items: center; gap: .75rem }
.goal > div { flex: 1; min-width: 0 }
.goal .row span { white-space: nowrap; font-variant-numeric: tabular-nums }
.badge { width: 2.75rem; height: 2.75rem; flex: none; border-radius: 26%; color: var(--brand); display: grid; place-items: center;
  background: linear-gradient(rgba(255,255,255,.36),rgba(255,255,255,0) 52%), color-mix(in srgb, var(--brand) 16%, var(--card));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent), 0 1px 2px rgba(0,0,0,.25) }
.badge svg { width: 1.5rem; height: 1.5rem }
.goal.done .badge { color: #fff; background: linear-gradient(rgba(255,255,255,.36),rgba(255,255,255,0) 52%), linear-gradient(160deg, var(--sa), var(--sk));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 3px rgba(0,0,0,.35) }
@media (forced-colors: active) { .emblem, .badge, .goal.done .badge { background: Canvas; color: CanvasText; border: 1px solid CanvasText; box-shadow: none } }
progress { display: block; width: 100%; height: .375rem; margin-top: .25rem; border: 0; border-radius: 1rem; overflow: hidden; background: var(--line); -webkit-appearance: none; appearance: none }
progress::-webkit-progress-bar { background: var(--line) }
progress::-webkit-progress-value { background: var(--brand) }
progress::-moz-progress-bar { background: var(--brand) }
@media (prefers-reduced-motion: reduce) { #sky i { animation: none } }
@media (forced-colors: active) { #sky { display: none } .season body { background: Canvas } }
