html {
  scroll-behavior: smooth;
}

#fun-page {
  --navy: #264653;
  --teal: #2a9d8f;
  --cream: #fff8e7;
  --coral: #f28482;
  --gold: #f4c95d;
  --ink: #263238;
  padding: 28px clamp(16px, 4vw, 56px) 60px;
}

#fun-page *,
.activity-modal * {
  box-sizing: border-box;
}

.fun-hero,
.featured-section,
.activity-browser {
  max-width: 1180px;
  margin-inline: auto;
}

.fun-hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.75fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(34px, 6vw, 72px);
  border: 6px solid var(--teal);
  border-radius: 28px;
  background: var(--cream);
  box-shadow: 8px 8px 0 var(--coral), 0 22px 44px rgba(25, 48, 57, 0.22);
  overflow: hidden;
}

.fun-eyebrow {
  margin: 0 0 10px;
  color: #1f746a;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fun-hero h2,
.section-heading h2,
.activity-modal h2 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
}

.fun-hero h2 {
  max-width: 760px;
  font-size: clamp(2.3rem, 5vw, 4.9rem);
  line-height: 0.98;
}

.fun-hero__copy > p:not(.fun-eyebrow) {
  max-width: 690px;
  margin: 24px 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.7;
}

.fun-hero__button,
.activity-card button,
.empty-state button,
.modal-source {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: var(--cream);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.fun-hero__button {
  padding: 12px 22px;
}

.fun-hero__button:hover,
.activity-card button:hover,
.empty-state button:hover,
.modal-source:hover {
  background: #1b7370;
}

.fun-hero__shapes {
  position: relative;
  min-height: 230px;
}

.fun-hero__shapes span {
  position: absolute;
  display: grid;
  place-items: center;
  border: 5px solid var(--navy);
  color: var(--navy);
  box-shadow: 5px 5px 0 rgba(38, 70, 83, 0.18);
}

.fun-hero__shapes span:nth-child(1) {
  width: 138px;
  height: 138px;
  top: 0;
  right: 18px;
  border-radius: 28px;
  background: var(--gold);
  font-size: 4rem;
  transform: rotate(9deg);
}

.fun-hero__shapes span:nth-child(2) {
  width: 105px;
  height: 105px;
  left: 0;
  bottom: 6px;
  border-radius: 50%;
  background: var(--coral);
  font-size: 2.4rem;
}

.fun-hero__shapes span:nth-child(3) {
  width: 78px;
  height: 78px;
  right: 2px;
  bottom: 6px;
  border-radius: 18px;
  background: var(--teal);
  color: var(--cream);
  font-size: 2rem;
  transform: rotate(-12deg);
}

.featured-section,
.activity-browser {
  margin-top: 62px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  color: var(--cream);
}

.section-heading h2 {
  color: var(--cream);
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.section-heading .fun-eyebrow {
  color: var(--gold);
}

.section-heading > p {
  max-width: 460px;
  margin: 0;
  line-height: 1.55;
}

.featured-grid,
.activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.activity-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  padding: 22px;
  border: 4px solid var(--teal);
  border-radius: 20px;
  background: var(--cream);
  box-shadow: 5px 5px 0 var(--coral);
}

.activity-card--featured {
  border-color: var(--gold);
  box-shadow: 5px 5px 0 var(--teal);
}

.activity-card__topline,
.activity-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-card__topline {
  justify-content: space-between;
  align-items: center;
}

.activity-card__category,
.activity-card__format,
.activity-card__meta span,
.modal-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #d8f1ed;
  color: #195d56;
  font-size: 0.76rem;
  font-weight: 800;
}

.activity-card__format {
  background: #fde2df;
  color: #8d3f3e;
}

.activity-card h3 {
  margin: 18px 0 10px;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  line-height: 1.12;
}

.activity-card__summary {
  flex: 1;
  margin: 0 0 18px;
  line-height: 1.55;
}

.activity-card__meta {
  margin-bottom: 18px;
}

.activity-card button {
  width: 100%;
  padding: 10px 16px;
}

.activity-tools {
  margin-bottom: 28px;
  padding: clamp(18px, 3vw, 30px);
  border: 4px solid var(--gold);
  border-radius: 20px;
  background: var(--cream);
  box-shadow: 5px 5px 0 var(--teal);
}

.search-field label,
.filter-group legend {
  color: var(--navy);
  font-weight: 800;
}

.search-field label {
  display: block;
  margin-bottom: 8px;
}

.search-field input {
  width: 100%;
  min-height: 50px;
  padding: 10px 16px;
  border: 3px solid #9ec9c3;
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.filter-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.filter-group {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 2px solid #cce2de;
  border-radius: 14px;
}

.filter-options {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.filter-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  cursor: pointer;
}

.filter-options input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.clear-filters {
  margin-top: 18px;
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid currentColor;
  background: transparent;
  color: #1f746a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.empty-state {
  padding: 48px 20px;
  border: 4px dashed var(--gold);
  border-radius: 20px;
  background: rgba(255, 248, 231, 0.96);
  text-align: center;
}

.empty-state span {
  color: var(--coral);
  font-size: 3rem;
}

.empty-state h3 {
  margin: 8px 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
}

.empty-state button {
  margin-top: 10px;
  padding: 10px 18px;
}

.activity-modal {
  --navy: #264653;
  --teal: #2a9d8f;
  --cream: #fff8e7;
  --coral: #f28482;
  --gold: #f4c95d;
  --ink: #263238;
  width: min(760px, calc(100% - 28px));
  max-height: min(88vh, 900px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: var(--ink);
}

.activity-modal::backdrop {
  background: rgba(18, 38, 45, 0.76);
  backdrop-filter: blur(3px);
}

.modal-shell {
  position: relative;
  max-height: min(88vh, 900px);
  overflow-y: auto;
  padding: clamp(24px, 5vw, 48px);
  border: 6px solid var(--teal);
  border-radius: 24px;
  background: var(--cream);
  box-shadow: inset 0 0 0 3px rgba(244, 201, 93, 0.5);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: white;
  color: var(--navy);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.activity-modal h2 {
  max-width: calc(100% - 44px);
  margin: 12px 0 18px;
  font-size: clamp(2rem, 5vw, 3.1rem);
}

.modal-intro {
  font-size: 1.08rem;
  line-height: 1.65;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.modal-panel {
  padding: 16px;
  border-radius: 14px;
  background: #eef7f5;
}

.modal-panel h3,
.modal-section h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 1rem;
}

.modal-panel p,
.modal-section p,
.modal-section ul {
  margin: 0;
  line-height: 1.55;
}

.modal-section {
  padding: 18px 0;
  border-top: 2px solid #d9e6e3;
}

.modal-section ul {
  padding-left: 22px;
}

.modal-attribution {
  margin-top: 24px;
  padding: 18px;
  border-radius: 14px;
  background: #fde9c1;
}

.modal-attribution a {
  color: #155d58;
  font-weight: 800;
}

.modal-source {
  margin-top: 14px;
  padding: 10px 18px;
}

:focus-visible {
  outline: 4px solid var(--gold, #f4c95d);
  outline-offset: 3px;
}

@media (max-width: 940px) {
  .featured-grid,
  .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #fun-page {
    padding: 18px 12px 42px;
  }

  .fun-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 28px 22px 32px;
    border-width: 4px;
    border-radius: 20px;
    box-shadow: 5px 5px 0 var(--coral);
  }

  .fun-hero__shapes {
    display: none;
  }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 10px;
  }

  .featured-grid,
  .activity-grid,
  .filter-groups,
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .activity-card {
    padding: 18px;
  }

  .modal-shell {
    padding: 54px 20px 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
