:root {
  color-scheme: dark;
  --bg: #071d29;
  --cream: #fff2dd;
  --ink: #112b34;
  --muted: #b2cbc9;
  --panel: #143340;
  --line: #5a7981;
  --coral: #ff7774;
  --teal: #58d3c3;
  --focus: #ffc44e;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  color: var(--cream);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; }
button, input { font: inherit; }
button {
  color: inherit;
  cursor: pointer;
  border: 0;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, label:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.card button:focus-visible { outline-color: #135b61; }
button:active { scale: .985; }
h1, h2, p { margin: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.shell { width: min(100%, 548px); margin-inline: auto; padding: 14px clamp(16px, 5vw, 30px) max(22px, env(safe-area-inset-bottom)); }
.topbar { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; min-height: 48px; }
.top-back { grid-column: 1; }
.top-share { grid-column: 3; }
.compact-brand {
  grid-column: 2; justify-self: center; display: grid; justify-items: center;
  min-height: 48px; padding-inline: 10px; border-radius: 12px; text-decoration: none;
  color: var(--muted);
}
.compact-brand img { display: block; object-fit: contain; }
.compact-brand span { font-size: .8125rem; font-weight: 700; line-height: 1.4; }
.compact-brand:hover { background: var(--panel); color: var(--cream); }
.compact-brand:hover span { text-decoration: underline; text-underline-offset: 3px; }
.icon-button {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; padding: 0;
}
.icon-button:hover { background: var(--panel); }
.masthead { margin: clamp(12px, 3svh, 29px) auto clamp(20px, 3.6svh, 35px); width: min(80%, 280px); }
.masthead img { display: block; width: 100%; height: auto; }
.choice-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.choice-group + .choice-group { margin-top: 24px; }
legend { padding: 0; margin-bottom: 10px; font-size: 1.06rem; font-weight: 750; }
.ages, .moods, .option-set { display: grid; gap: 8px; }
.ages { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.moods { grid-template-columns: 1.16fr .87fr .95fr 1.09fr; }
.choice {
  position: relative; display: grid; place-items: center; min-height: 44px; padding: 7px 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  font-weight: 700; text-align: center; cursor: pointer; touch-action: manipulation;
}
.choice:hover { border-color: var(--muted); }
.choice:has(input:checked) { color: var(--ink); border-color: var(--cream); background: var(--cream); }
.ages .choice:has(input:checked) { border-color: var(--teal); background: var(--teal); }
.ages .choice span { display: inline-flex; gap: 3px; align-items: center; }
.age-check { display: none; width: 13px; height: 13px; stroke-width: 2.1; }
.ages input:checked + span .age-check { display: inline-block; }
.moods .choice { border-radius: 99px; font-size: clamp(.76rem, 3.55vw, .94rem); }
.generate-actions { display: grid; margin-top: 8px; }
.primary, .secondary {
  min-height: 49px; border-radius: 99px; padding: 10px 16px;
  font-weight: 780; line-height: 1.18; text-align: center; touch-action: manipulation;
}
.primary { background: var(--coral); color: var(--ink); font-size: 1.03rem; }
.primary:hover { background: #ff918b; }
.generate-actions .primary { min-height: 61px; font-size: 1.3rem; letter-spacing: -.025em; }
.secondary { border: 1px solid var(--line); background: var(--panel); }
.secondary:hover { background: #1b4553; }
.text-button {
  display: inline-flex; min-height: 44px; padding: 4px 5px; gap: 5px; align-items: center;
  justify-content: center; background: transparent; color: var(--muted); font-size: .93rem;
}
.text-button:hover { color: var(--cream); text-decoration: underline; text-underline-offset: 3px; }
.text-button svg { width: 16px; height: 16px; }
#open-filters { justify-self: center; }
.filter-count { padding: 2px 6px; border-radius: 99px; font-size: .72rem; background: var(--panel); color: var(--cream); }
.field-error { margin-top: 8px; color: #ffb3ae; font-size: .9rem; }
#result, #empty, #saved { margin-top: 15px; }
.result-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; color: var(--muted); font-size: .87rem; }
.card {
  color-scheme: light; color: var(--ink); background: var(--cream); border-radius: 24px;
  padding: clamp(17px, 5vw, 29px);
}
.activity-card {
  display: grid; align-content: center; min-height: clamp(215px, 34svh, 268px);
  padding: clamp(20px, 6vw, 32px);
}
.reveal { animation: reveal .24s ease-out both; }
@keyframes reveal { from { opacity: .35; transform: translateY(7px); } }
.card-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.card-heading h1 { margin-top: 5px; overflow-wrap: anywhere; }
.card .icon-button:disabled { cursor: default; }
.category {
  width: 53px; height: 53px; flex: 0 0 auto; border-radius: 14px;
  display: grid; place-items: center; background: var(--accent);
}
.category img { width: 30px; height: 30px; }
.card .icon-button { border-color: #9e8e73; }
.card .icon-button:hover { background: #f2e2c9; }
.card .icon-button[aria-pressed="true"] svg { fill: #ac363b; stroke: #ac363b; }
.card h1 { font-size: clamp(1.68rem, 6.9vw, 2.4rem); line-height: 1.06; letter-spacing: -.055em; }
.activity-card h1 { font-size: clamp(1.85rem, 7.9vw, 2.45rem); }
.card h1:focus, .empty-card h1:focus, .saved-title:focus { outline: none; }
.activity-setup { margin-top: 16px; font-size: .82rem; font-weight: 650; color: #315960; line-height: 1.35; overflow-wrap: anywhere; }
.activity-paragraph, .activity-instructions {
  margin: 12px 0 0; font-size: clamp(1.1875rem, 4.9vw, 1.25rem); line-height: 1.5; overflow-wrap: anywhere;
}
.activity-instructions { display: grid; gap: 10px; padding-inline-start: 1.45em; }
.activity-instructions li { padding-inline-start: 3px; }
.activity-instructions li::marker { color: #315960; font-weight: 800; }
.result-actions { display: grid; margin-top: 12px; }
.extra-actions { display: flex; gap: 18px; justify-content: center; }
.pool-note { color: var(--muted); font-size: .85rem; line-height: 1.45; margin-top: 12px; text-align: center; }
.empty-card { display: grid; gap: 13px; margin-top: 24px; }
.empty-card p { line-height: 1.5; }
.saved-title { font-size: 1.7rem; letter-spacing: -.045em; margin: 24px 0 17px; }
.saved-list { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.saved-item { display: flex; gap: 8px; align-items: center; background: var(--panel); border-radius: 15px; padding: 6px; }
.saved-item .category { width: 42px; height: 42px; border-radius: 10px; }
.saved-item .category img { width: 23px; height: 23px; }
.saved-open { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px; text-align: left; background: transparent; font-weight: 700; border-radius: 12px; }
.saved-open:hover { text-decoration: underline; }
.saved-empty { color: var(--muted); line-height: 1.5; }
#filters {
  --sheet-height: calc(100dvh - 22px);
  color: var(--cream); background: #0f2b38; border: 1px solid var(--line); border-radius: 23px;
  max-height: var(--sheet-height); width: min(100% - 24px, 488px); padding: 0; overflow: hidden;
}
#filters::backdrop { background: rgb(0 10 18 / 72%); }
body:has(dialog[open]) { overflow: hidden; }
.filter-form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: var(--sheet-height); }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px 8px; }
.sheet-heading h2 { font-size: 1.43rem; letter-spacing: -.04em; }
#filter-fields { overflow: auto; overscroll-behavior: contain; padding: 4px 16px 14px; }
.filter-field { border: 0; min-width: 0; padding: 0; margin: 0; }
.filter-field + .filter-field { margin-top: 14px; padding-top: 4px; }
.filter-field legend { font-size: .88rem; margin-bottom: 6px; }
.option-set { display: grid; grid-template-columns: repeat(auto-fit, minmax(75px, 1fr)); gap: 5px; }
.filter-field[data-filter="involvement"] .option-set { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option-set .choice { padding: 4px 5px; border-radius: 10px; font-size: .8rem; min-height: 44px; }
.option-set .choice:has(input:checked) { background: #bee8dc; border-color: #bee8dc; }
.sheet-footer { border-top: 1px solid #315563; padding: 8px 16px max(12px, env(safe-area-inset-bottom)); }
#filter-matches { color: var(--muted); font-size: .83rem; line-height: 1.35; margin-bottom: 7px; }
.sheet-actions { display: flex; gap: 8px; }
#apply-filters { flex: 1; }
#apply-filters:disabled { opacity: .48; cursor: default; }
.sr-only, .choice input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
@media (max-width: 560px) {
  #filters { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-height: 650px) and (max-width: 420px) {
  .shell { padding-top: 9px; padding-bottom: 10px; }
  .masthead { width: min(76%, 225px); margin-block: 9px 19px; }
  .choice-group + .choice-group { margin-top: 17px; }
  .generate-actions { margin-top: 6px; }
  .generate-actions .primary { min-height: 54px; }
  #result { margin-top: 6px; }
  .result-meta:has(> span) { justify-content: flex-end; min-height: 20px; }
  .result-meta:has(> span) > button { display: none; }
  .activity-card { padding: 16px; }
  .activity-paragraph, .activity-instructions { margin-top: 12px; line-height: 1.4; }
  .activity-instructions { gap: 8px; padding-inline-start: 1.25em; }
}
