:root { color-scheme: light dark; --line: #8886; --accent: #1b7f4b; }
* { box-sizing: border-box; }
body { margin: 0 auto; max-width: 36rem; padding: 0 1rem 3rem; font: 1.05rem/1.5 system-ui, sans-serif; }
header, nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
header { justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: inherit; text-decoration: none; }
label { display: block; margin: 1rem 0; }
input, select, button { width: 100%; min-height: 2.75rem; padding: 0.5rem; font: inherit; border: 1px solid var(--line); border-radius: 0.5rem; }
button { background: var(--accent); color: white; font-weight: 600; cursor: pointer; }
button.link { width: auto; min-height: 0; padding: 0; border: 0; background: none; color: inherit; font-weight: 400; text-decoration: underline; }
li { margin: 0.5rem 0; }
code { overflow-wrap: anywhere; }
.error, .notice { padding: 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; }
.error { border-color: #c0392b; }
.hint { opacity: 0.75; }
input, select, textarea { width: 100%; padding: 0.5rem; font: inherit; border: 1px solid var(--line); border-radius: 0.5rem; }
input[type="radio"], input[type="checkbox"] { width: auto; min-height: 0; }
fieldset { margin: 1rem 0; border: 1px solid var(--line); border-radius: 0.5rem; }
.choice { margin: 0.25rem 0; padding: 0.4rem 0; }
article { margin: 1rem 0; padding: 0 1rem; border: 1px solid var(--line); border-radius: 0.5rem; }
article h2 { margin: 0.75rem 0 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.text { white-space: pre-line; overflow-wrap: anywhere; }
details { margin-bottom: 1rem; }
.button { display: block; padding: 0.6rem; border-radius: 0.5rem; background: var(--accent); color: white; font-weight: 600; text-align: center; text-decoration: none; }
#preview { margin: 1rem 0; }
/* Show only the questions for the chosen kind of goal. */
.for-repeat, .for-once, .for-limit { display: none; }
form:has(#shape-repeat:checked) .for-repeat, form:has(#shape-once:checked) .for-once, form:has(#shape-limit:checked) .for-limit { display: block; }

form:not(:has(#once-finish:checked)) .for-finish, form:not(:has(#once-yearly_limit:checked)) .for-yearly { display: none; }
.choice { display: flex; gap: 0.6rem; align-items: baseline; }
.choice small { display: block; opacity: 0.75; }
.rules { margin: 1rem 0; padding: 0.75rem; border-left: 3px solid var(--accent); background: #8881; font-size: 0.95rem; }
.rules ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.rules summary { cursor: pointer; font-weight: 600; }
/* Two goals side by side, or stacked on a narrow phone. */
.duel { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 0 1rem; }
.duel article { display: flex; flex-direction: column; padding-bottom: 1rem; }
.duel article h3 { margin: 0; overflow-wrap: anywhere; }
.duel article button { margin-top: auto; overflow-wrap: anywhere; }
.owner { margin: 0.75rem 0 0; opacity: 0.75; overflow-wrap: anywhere; }
.question { font-size: 1.15rem; outline: none; }
button.plain { margin-top: 0.5rem; background: none; color: inherit; }
button:disabled { opacity: 0.5; }
article .owner + h2 { margin-top: 0; }
.duel article { margin: 0.5rem 0; }
.duel article p { margin: 0.35rem 0; }
.question { margin: 0.5rem 0; }
/* The main menu stays at the bottom, in reach of a thumb. */
body { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
header { padding-top: calc(1rem + env(safe-area-inset-top)); }
.bottom { position: fixed; inset: auto 0 0; z-index: 1; display: flex; flex-wrap: nowrap; gap: 0; justify-content: center; padding-bottom: env(safe-area-inset-bottom); background: Canvas; border-top: 1px solid var(--line); }
.bottom a { flex: 1; max-width: 9rem; padding: 0.9rem 0.25rem; color: inherit; font-size: 0.95rem; text-align: center; text-decoration: none; }
[aria-current="page"] { font-weight: 700; box-shadow: inset 0 -3px var(--accent); }
/* Today */
.score { font-size: 1.15rem; }
.check { padding-bottom: 0.75rem; }
.check p { margin: 0.4rem 0; overflow-wrap: anywhere; }
.check h2 { outline: none; }
.check details { margin: 0.5rem 0 0; }
.check summary { padding: 0.4rem 0; cursor: pointer; }
.check button.link { min-height: 2.75rem; }
button.big { min-height: 3.5rem; font-size: 1.15rem; }
button.big:active { transform: scale(0.97); }
.check.done { border-color: var(--accent); background: #1b7f4b1c; }
.progress { display: flex; gap: 0.75rem; align-items: center; }
progress { flex: 1; min-width: 0; accent-color: var(--accent); }
.urgent { font-weight: 700; color: #b03020; }
.tick { font-size: 1.15rem; font-weight: 700; }
.tick span { display: inline-block; width: 1.8rem; border-radius: 50%; background: var(--accent); color: white; line-height: 1.8rem; text-align: center; }
@media (prefers-color-scheme: dark) { .urgent { color: #ff9485; } }
@media (prefers-reduced-motion: no-preference) {
  .just-checked { animation: glow 0.6s ease-out; }
  .just-checked .tick span { animation: pop 0.45s cubic-bezier(0.2, 1.8, 0.4, 1); }
  progress, button { transition: transform 0.1s; }
}
@keyframes glow { 0% { box-shadow: 0 0 0 0 #1b7f4bcc; } 100% { box-shadow: 0 0 0 1rem #1b7f4b00; } }
@keyframes pop { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: none; } }
/* Leaderboard and player pages */
.tabs { flex-wrap: nowrap; overflow-x: auto; gap: 0; }
.tabs a { padding: 0.6rem 0.9rem; color: inherit; text-decoration: none; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--line); text-align: left; }
td.name { overflow-wrap: anywhere; }
th.number, td.number { text-align: right; font-variant-numeric: tabular-nums; }
td small { display: block; opacity: 0.75; }
.me { background: #1b7f4b1c; font-weight: 600; }
.results { padding: 0; list-style: none; }
.results li { display: flex; gap: 0.5rem; margin: 0.25rem 0; }
.results .number { margin-left: auto; }
/* Feed */
.bottom a { font-size: 0.82rem; }
.dot { display: inline-block; width: 0.55rem; height: 0.55rem; margin-left: 0.2rem; border-radius: 50%; background: #d4452c; }
.dot[hidden] { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.post { padding-bottom: 0.75rem; }
.post p { margin: 0.35rem 0; overflow-wrap: anywhere; }
.post.miss { border-style: dashed; }
.post details { margin: 0.25rem 0; }
.post summary { padding: 0.4rem 0; cursor: pointer; }
.tick-small { color: var(--accent); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
button.chip { width: auto; padding: 0.3rem 0.75rem; border-radius: 1.5rem; background: none; color: inherit; font-weight: 400; overflow-wrap: anywhere; }
button.chip[aria-pressed="true"] { border-color: var(--accent); background: #1b7f4b2c; }
.line { display: flex; gap: 0.5rem; margin: 0.4rem 0; }
.line input { flex: 1; min-width: 0; }
.line button { width: auto; }
.comment { border-top: 1px solid var(--line); }
