.family-root {
  overflow: auto;
  touch-action: auto;
}

.family {
  min-height: 100dvh;
  height: auto;
  overflow: auto;
  background: var(--sand) url("assets/bg-menu.jpg") center / cover fixed;
  touch-action: manipulation;
  user-select: auto;
  -webkit-user-select: auto;
}

.family [hidden] {
  display: none !important;
}

.family-main {
  width: min(100%, 47rem);
  margin: 0 auto;
  padding: clamp(0.9rem, 4dvh, 2.4rem) 1rem 2rem;
}

.family-main h1 {
  color: var(--sunflower);
  text-align: center;
  font-size: clamp(2.15rem, 7vw, 3.7rem);
  font-weight: 900;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 4px 0 var(--ink);
  margin: 0 0 1rem;
}

.family-panel {
  width: min(100%, 31rem);
  margin: 0 auto;
  padding: clamp(0.9rem, 3vw, 1.5rem);
  background: var(--foam);
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 1.3rem;
  box-shadow: 0 6px 0 var(--ink);
}

.family-panel h2,
.family-panel h3 {
  margin: 0 0 0.75rem;
}

.caregiver-panel {
  width: 100%;
}

#picker-panel {
  width: min(100%, 38rem);
  text-align: center;
}

.family-heading,
.family-actions,
.child-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  justify-content: space-between;
}

.family-form {
  display: grid;
  gap: 0.45rem;
}

.family-form label,
.family-form legend {
  font-weight: 800;
}

.family-form input:not([type="radio"]):not([type="checkbox"]),
.family select,
.report-filters input {
  width: 100%;
  min-height: 44px;
  padding: 0.45rem 0.7rem;
  border: 2px solid var(--ink);
  border-radius: 0.6rem;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.family-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0.35rem 0 0.6rem;
  border: 0;
}

.family .btn,
.family-link {
  min-height: 44px;
  font-size: 1rem;
}

.family-secondary {
  background: #a0e3df;
}

.family-link {
  padding: 0.35rem 0.15rem;
  border: 0;
  background: none;
  color: var(--ink);
  text-decoration: underline;
  font-weight: 800;
  cursor: pointer;
}

.family button:disabled {
  opacity: 0.65;
  cursor: progress;
}

.family-status {
  max-width: 31rem;
  margin: 0 auto 1rem;
  padding: 0.65rem 0.8rem;
  background: var(--foam);
  border: 2px solid var(--ink);
  border-radius: 0.65rem;
  font-weight: 800;
}

.family-note {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 400;
}

.profile-grid,
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.5rem 0 1.1rem;
}

.profile-grid { justify-content: center; }

.profile-card,
.icon-picker label {
  display: grid;
  place-items: center;
  background: white;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 0.8rem;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}

.profile-card {
  gap: 0.4rem;
  min-width: clamp(6.75rem, 17vw, 8.5rem);
  max-width: 10rem;
  min-height: clamp(7.5rem, 22dvh, 9.3rem);
  padding: 0.65rem;
  font: inherit;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.profile-card img {
  width: 4.1rem;
  height: 4.1rem;
  object-fit: contain;
}

.icon-picker label {
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
}

.icon-picker input {
  position: absolute;
  opacity: 0;
}

.icon-picker label:has(input:checked) { background: #a0e3df; }
.family button:focus-visible,
.family a:focus-visible,
.family input:focus-visible,
.family select:focus-visible,
.icon-picker label:has(input:focus-visible) { outline: 3px solid var(--coral); outline-offset: 3px; }

.icon-picker img,
.child-list img {
  width: 2.15rem;
  height: 2.15rem;
  object-fit: contain;
}

.child-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 1.2rem;
}

.child-list li {
  justify-content: flex-start;
  border-bottom: 1px solid #dbcdbc;
  padding: 0.55rem 0;
}

.child-list li strong {
  min-width: 5rem;
  overflow-wrap: anywhere;
}

.child-list .family-link { margin-left: auto; }
.family-actions { margin-top: 0.85rem; }

#remove-dialog {
  margin: auto;
  width: min(29rem, calc(100% - 1.5rem));
}

.avatar-dialog {
  margin: auto;
  width: min(35rem, calc(100% - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  overflow: auto;
  touch-action: pan-y;
}

#remove-dialog::backdrop,
.avatar-dialog::backdrop { background: rgba(27, 42, 74, 0.48); }

.saved-avatar {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin: 0.65rem 0;
}

.saved-avatar img {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: contain;
  border-radius: 0.75rem;
  background: #afdee9;
}

.saved-avatar strong { display: block; }

.avatar-preview {
  margin: 0.8rem 0;
  padding: 0.65rem;
  text-align: center;
  border: 2px solid var(--ink);
  border-radius: 0.8rem;
  background: #d6eff3;
}

.avatar-preview img {
  display: block;
  width: 100%;
  height: clamp(7.5rem, 27dvh, 12rem);
  object-fit: contain;
}

#avatar-status { margin: 0.7rem 0 0; }

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.7rem 0 1.25rem;
  padding: 0.3rem;
  border-radius: 0.9rem;
  background: #ebdfd1;
}

.portal-nav button {
  min-height: 44px;
  flex: 1 1 5.5rem;
  padding: 0.35rem 0.65rem;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 28rem) {
  .portal-nav button { flex-basis: 4.3rem; padding-inline: 0.25rem; }
}

.portal-nav [aria-current="page"] {
  background: var(--ink);
  color: white;
}

.portal-view {
  min-width: 0;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  align-items: start;
  gap: 0.5rem 0.8rem;
  margin-block: 0.65rem;
}

.report-filters label,
.report-archive label {
  font-weight: 800;
}

.report-filters select,
.report-filters input {
  display: block;
  margin: 0.25rem 0 0;
}

.report-filters button { align-self: end; }

.report-evidence {
  display: grid;
  gap: 0.65rem;
  margin-block: 0.9rem;
}

.family-status[role="status"]:empty,
.family-note[role="status"]:empty { display: none; }

.portal-view .family-status {
  margin: 0.75rem 0 0;
  max-width: none;
}

.activity-card,
.portal-empty {
  overflow-wrap: anywhere;
  margin: 0;
  padding: 0.8rem;
  border: 1px solid #d9ccbe;
  border-radius: 0.8rem;
  background: #fffdf8;
}

.activity-card h4,
.activity-card p,
.observations { margin: 0 0 0.45rem; }
.activity-card h4 { font-size: 1.1rem; }
.evidence-detail strong { display: block; }
.observations { padding-left: 1.2rem; }
.observations li + li { margin-top: 0.5rem; }
.observations p { margin: 0.2rem 0 0; }

.report-archive {
  border-top: 1px solid #dbcdbc;
  padding-top: 1rem;
  margin-top: 1.1rem;
}

.report-archive label {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.report-archive select {
  width: auto;
  max-width: 100%;
}

.portal-list {
  display: grid;
  list-style: none;
  padding: 0;
  margin: 0.55rem 0 1rem;
  overflow-wrap: anywhere;
}

.portal-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid #dbcdbc;
}

.portal-list p { margin: 0.2rem 0 0; }

.family-checkbox {
  display: flex;
  align-items: start;
  gap: 0.55rem;
  margin: 0.45rem 0;
}

.family-checkbox input {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.12rem 0 0;
}

.child-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem 0.7rem;
}

.child-actions .family-link { margin-left: 0; }
.child-list .family-note { margin: 0.3rem 0 0; }

.portal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 0.8rem;
  margin-top: 1.4rem;
}

.portal-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0.7rem;
  border-radius: 0.5rem;
  background: var(--foam);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

#saved-report-title { margin-top: 0.5rem; }
#public-remove-panel .family-link { display: inline-block; margin-right: 0.55rem; }

.tablet-downloads {
  padding: 0.65rem 0.8rem;
  margin: 0 0 1rem;
  border: 1px solid #dbcdbc;
  border-radius: 0.65rem;
}

.tablet-downloads summary {
  padding: 0.2rem 0;
  cursor: pointer;
  font-weight: 800;
}

.curriculum-heading,
.curriculum-suggestion { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; }
.curriculum-heading { justify-content: space-between; }
.curriculum-heading label { display: flex; align-items: center; gap: .5rem; font-weight: 800; }
.curriculum-heading select { width: auto; max-width: 13rem; margin: 0; }
.curriculum-suggestion { padding: .65rem 1rem; margin: .75rem 0 1.25rem; border-radius: .8rem; background: #e1efe8; }
.curriculum-suggestion strong { font-size: .92rem; }
.curriculum-suggestion button { margin: 0; text-align: start; }
.curriculum-layout { display: grid; grid-template-columns: minmax(9rem,.85fr) minmax(0,2fr); align-items: start; gap: 1.2rem; }
#curriculum-areas { display: grid; gap: .25rem; }
#curriculum-areas button { min-height: 44px; border: 0; background: transparent; border-radius: .45rem; text-align: start; padding: .5rem .65rem; color: var(--ink); font: inherit; cursor: pointer; }
#curriculum-areas button[aria-pressed=true] { background: #dbeaf0; font-weight: 800; }
#curriculum-area-title { margin: .45rem 0 .7rem; font-size: 1.15rem; }
.curriculum-lessons { list-style: none; margin: 0; padding-left: 1rem; border-left: 2px solid #a5bdbc; }
.curriculum-lessons li { position: relative; margin-bottom: .6rem; }
.curriculum-lessons li::before { content: ""; position: absolute; width: .65rem; height: .65rem; top: 1.1rem; left: -1.41rem; border: 2px solid #4b696e; background: var(--foam); border-radius: 50%; }
.curriculum-lessons li[data-state=completed]::before { background: #27745d; }
.curriculum-lessons li[data-state=practiced]::before { background: #e9bf65; }
.curriculum-lessons details { border: 1px solid #bdcbc9; border-radius: .65rem; padding: 0 .75rem; }
.curriculum-lessons summary { padding: .7rem 0; cursor: pointer; min-height: 44px; }
.curriculum-state { font-size: .82rem; margin-left: .6rem; color: #445663; }
.curriculum-lessons p { margin: 0 0 .7rem; }
.curriculum-game { font-weight: 800; }
@media (max-width: 35rem) {
  .curriculum-layout { grid-template-columns: 1fr; gap: .6rem; }
  #curriculum-areas { display: flex; gap: .15rem; flex-wrap: wrap; }
}

/* The caregiver and profile entry share snapdly's neutral palette. Each game's theme begins at play. */
.family-root { background: var(--brand-paper); }
.family { background: var(--brand-paper); color: var(--brand-ink); }
.family-main { width: min(100%, 58rem); }
.family-masthead { display: flex; justify-content: space-between; align-items: center; max-width: 54rem; margin: 0 auto clamp(1.2rem, 4vh, 2.8rem); padding: .3rem 0 1rem; border-bottom: 1px solid #dad2c7; }
.family-main .family-masthead h1 { font-size: 1rem; text-align: left; -webkit-text-stroke: 0; text-shadow: none; margin: 0; }
.discover-link { color: #473562; font-weight: 800; text-decoration: none; padding: .6rem 0 .6rem .6rem; }
.discover-link:hover { text-decoration: underline; }
.family-panel { color: var(--brand-ink); border: 1px solid #d5cfd8; background: #fffdf8; border-radius: 1.2rem; box-shadow: 0 4px 16px #3025440d; }
.family-panel h2 { font-family: Fredoka,Nunito,sans-serif; font-weight: 550; }
.family .btn { color: white; background: var(--brand-plum); border: 2px solid var(--brand-plum); box-shadow: none; }
.family .family-secondary { color: var(--brand-ink); background: #ede8f7; border-color: #d4c7e6; }
.family-form input:not([type="radio"]):not([type="checkbox"]), .family select, .report-filters input { border: 1px solid #82788b; }
.entry-intro { margin: .1rem 0 1.3rem; color: #575162; }
#account-panel { padding: clamp(1.3rem,4vw,2.35rem); }
#account-panel h2 { font-size: clamp(1.85rem,4.5vw,2.4rem); line-height: 1.1; }
#account-form .btn { margin-top: .35rem; }
.family #tablet-invitation { border-top: 1px solid #ddd6d3; padding-top: .6rem; margin-top: .7rem; }
.family #tablet-invitation summary { cursor: pointer; color: #4e3875; font-weight: 800; padding: .4rem 0; }
.family-theme { display: inline-flex; align-items: center; gap: .65rem; padding: .25rem .85rem .25rem .3rem; min-height: 44px; margin-bottom: .75rem; font: 800 .95rem Nunito,sans-serif; color: #372c4e; border: 1px solid #c1b0d7; border-radius: 3rem; background: #f4eefb; cursor: pointer; }
.family-theme img { width: 2.35rem; height: 2.35rem; border-radius: 50%; object-fit: cover; }
.family .portal-footer a { background: transparent; color: #514262; }
.family:has(#picker-panel:not([hidden])) .discover-link { display:none; }
