/* Reward plan worksheet. Standalone like swim-meet-checklist.css, in the
   KeepsMeS palette (pool teal / cyan / gold). Motion only under html.motion-on
   (kms-motion.js); OS reduced-motion gets the gentle tier (fades, no burst). */
:root {
  color-scheme: light;
  --ink: #0c2027;
  --muted: #36505a;
  --teal: #0b6e82;
  --cyan: #12a0bc;
  --gold: #e39b2e;
  --line: #9bb3ba;
  --paper: #f6fafb;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: var(--paper); }
[hidden] { display: none !important; }
.rp { width: min(100%, 60rem); margin: auto; padding: 1.5rem 16px 3rem; }
@media (min-width: 640px) { .rp { padding: 2.25rem 2rem 4rem; } }
.rp-head { border-top: 5px solid var(--teal); padding-top: .75rem; }
.rp-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--teal); font-weight: 650; text-underline-offset: .18em; }
h1 { margin: .4rem 0 .35rem; font: 700 clamp(2rem, 6vw, 3.1rem)/1.08 Outfit, Inter, system-ui, sans-serif; }
.rp-lede { margin: 0 0 1rem; font-size: 1.15rem; color: var(--muted); }
.rp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.rp-btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: .6rem 1.1rem;
  border: 1px solid var(--teal); border-radius: 10px; background: #fff; color: var(--teal);
  font: 650 1rem Inter, system-ui, sans-serif; text-decoration: none; cursor: pointer;
}
.rp-btn-1 { background: var(--teal); color: #fff; }
.rp-btn:focus-visible, .rp-chip:focus-visible, .motion-toggle:focus-visible,
.rp-box input:focus-visible + span, .rp-field :focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.motion-toggle {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .4rem .9rem;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink);
  font: 600 .9rem Inter, system-ui, sans-serif; cursor: pointer;
}
.mt-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--teal); }
.motion-toggle[aria-pressed="false"] .mt-dot { background: var(--line); }
.rp-note { margin: .75rem 0 0; color: var(--muted); font-size: .92rem; }

.rp-sec { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
h2 { margin: 0 0 .25rem; color: var(--teal); font: 700 1.5rem/1.2 Outfit, Inter, system-ui, sans-serif; }
.rp-hint { margin: 0 0 1rem; color: var(--muted); line-height: 1.5; }
.rp-field { display: grid; gap: .35rem; min-width: 0; margin-bottom: .9rem; font-weight: 650; }
.rp-field input, .rp-field textarea, .rp-field select {
  width: 100%; min-width: 0; min-height: 48px; padding: .6rem .75rem;
  border: 1px solid #6f8a92; border-radius: 10px; background: #fff; color: var(--ink);
  font: 400 1rem/1.4 Inter, system-ui, sans-serif;
}
.rp-field textarea { resize: vertical; }
.rp-row { display: grid; gap: 0 .9rem; grid-template-columns: 1fr 1fr; }
.rp-deals { display: grid; gap: 1rem; }
@media (min-width: 900px) { .rp-deals { grid-template-columns: repeat(3, 1fr); } }
.rp-deal {
  position: relative; min-width: 0; margin: 0; padding: 1rem; border: 1px solid var(--line);
  border-radius: 14px; background: #fff;
}
.rp-deal legend { padding: 0 .35rem; font: 700 1.1rem Outfit, Inter, system-ui, sans-serif; }
.rp-optional { color: var(--muted); font: 500 .85rem Inter, system-ui, sans-serif; }
.rp-track { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.rp-box { position: relative; display: inline-grid; place-items: center; width: 48px; height: 48px; cursor: pointer; }
.rp-box input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.rp-box span {
  display: grid; place-items: center; width: 100%; height: 100%; border: 2px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--muted); font-weight: 700; pointer-events: none;
}
.rp-box input:checked + span { border-color: var(--teal); background: var(--teal); color: #fff; }
.rp-box input:checked + span::after { content: "\2713"; position: absolute; font-size: 1.4rem; }
.rp-box input:checked + span { font-size: 0; }
.rp-earned {
  margin: .9rem 0 0; padding: .6rem .8rem; border-radius: 10px; background: #fdf3e2;
  color: #7a4a06; font-weight: 700;
}
.rp-deal.is-earned { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(227, 155, 46, .35); }
.rp-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.rp-chip {
  min-height: 44px; padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink); font: 500 .95rem Inter, system-ui, sans-serif; cursor: pointer; text-align: left;
}
.rp-chip.is-used { border-color: var(--teal); background: #e6f3f6; }
.rp-foot { margin-top: 2.5rem; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.rp-foot a { color: var(--teal); }

/* Motion: on by default (site policy), off via the Animations switch. */
html.motion-on .rp-box input:checked + span { animation: rp-pop .32s cubic-bezier(.3, 1.6, .5, 1); }
html.motion-on .rp-deal.rp-celebrate .rp-earned { animation: rp-rise .45s ease-out; }
html.motion-on .rp-deal.rp-celebrate::before,
html.motion-on .rp-deal.rp-celebrate::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; border-radius: 50%;
  pointer-events: none; animation: rp-burst .9s ease-out forwards;
  box-shadow: 0 -70px var(--gold), 60px -40px var(--cyan), 70px 20px var(--teal), 30px 65px var(--gold),
    -35px 60px var(--cyan), -70px 15px var(--gold), -55px -45px var(--teal), 0 0 var(--gold);
}
html.motion-on .rp-deal.rp-celebrate::after { transform: rotate(22deg); animation-delay: .08s; }
@keyframes rp-pop { 0% { transform: scale(.7); } 100% { transform: scale(1); } }
@keyframes rp-rise { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes rp-burst { 0% { opacity: 1; transform: scale(.2); } 100% { opacity: 0; transform: scale(1.4); } }
@media (prefers-reduced-motion: reduce) {
  html.motion-on .rp-box input:checked + span { animation: rp-fade .2s ease-out; }
  html.motion-on .rp-deal.rp-celebrate::before, html.motion-on .rp-deal.rp-celebrate::after { display: none; }
  html.motion-on .rp-deal.rp-celebrate .rp-earned { animation: rp-fade .3s ease-out; }
}
@keyframes rp-fade { from { opacity: .3; } to { opacity: 1; } }

@media print {
  .screen-only, .rp-chips { display: none !important; }
  body, .rp-deal { background: #fff; }
  .rp { padding: 0; width: 100%; }
  .rp-sec { margin-top: 1rem; padding-top: .6rem; break-inside: avoid; }
  .rp-deals { grid-template-columns: repeat(3, 1fr); }
  .rp-field input, .rp-field textarea, .rp-field select { border-color: #555; }
  .rp-deal { break-inside: avoid; box-shadow: none; }
}
