:root {
  color-scheme: light;
  --paper: #fffaf0;
  --ink: #183f34;
  --muted: #4a6256;
  --line: #dedccf;
  --orange: #fed182;
  --mint: #e0edce;
  --wb-map-ink: var(--ink);
  --wb-map-paper: var(--paper);
  font: 16px/1.5 Nunito, "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box }
body { background: var(--paper); color: var(--ink); margin: 0 }
img { max-width: 100% }
a { color: inherit }
button, select { font: inherit }
button { cursor: pointer; color: inherit }
[hidden] { display: none !important }
:focus-visible { outline: 3px solid #1a6d68; outline-offset: 4px }
.frame { width: min(1312px, 91vw); margin-inline: auto }
.skip-link { position: absolute; top: 0; left: 12px; padding: 10px; z-index: 9; background: white; translate: 0 -120% }
.skip-link:focus { translate: 0 }
.site-header { background: #fffdf7; border-bottom: 1px solid #e7e4d7 }
.site-nav { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 16px }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 950; font-size: 25px; letter-spacing: -.045em; text-decoration: none }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; background: var(--ink); color: #fff4ce; border-radius: 50% 50% 47% 43%; font-size: 21px; letter-spacing: 0 }
nav { display: flex; gap: 4px; align-items: center; justify-content: center }
nav a, .library-tabs a { text-decoration: none; font-weight: 800; padding: 8px 16px; border-radius: 24px; white-space: nowrap }
nav a:hover, nav a[aria-current], .library-tabs a:hover { background: var(--mint) }
.studio-link { color: var(--muted); font-size: 14px; font-weight: 750; text-underline-offset: 3px; white-space: nowrap }
.welcome { display: grid; grid-template-columns: .92fr 1.32fr; margin: 30px 0 0; border-radius: 24px; border: 1px solid #d5dfc3; overflow: hidden; background: #eaf0d8 }
.welcome-copy { padding: clamp(20px, 4.3vw, 66px); display: flex; flex-direction: column; align-items: start; justify-content: center }
.kicker { margin: 0 0 7px; font-weight: 900; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #3f604b }
.welcome .kicker { display: flex; gap: 8px; align-items: center }
.welcome .kicker span { width: 10px; height: 10px; border-radius: 50%; background: #db9a48 }
h1,h2,h3 { margin: 0; font-weight: 950; letter-spacing: -.052em; line-height: 1.08; text-wrap: balance }
h1 { font-size: clamp(45px, 5.6vw, 88px); line-height: .99; margin: 6px 0 0 }
.welcome-copy > p:not(.kicker) { color: #3b584a; max-width: 29ch; margin: 16px 0 0; font-size: clamp(17px, 1.65vw, 22px); font-weight: 650 }
.welcome-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 25px 0 19px }
.primary, .secondary { border-radius: 24px; padding: 10px 16px; min-height: 44px; font-weight: 850 }
.primary { color: #fffaf0; background: var(--ink); border: 1px solid var(--ink) }
.primary:hover { background: #255b4b }
.primary span { margin-right: 6px; color: var(--orange) }
.primary:disabled, .secondary:disabled { opacity: .55; cursor: default }
.secondary { background: #fffdf7; border: 1px solid #bdcdbf }
.secondary:hover { background: var(--mint) }
.plain-link, .bare { font-weight: 850; text-underline-offset: 4px; border: 0; background: transparent; padding: 0; text-decoration: underline }
.welcome small { color: #486653; font-weight: 700 }
.welcome-art { position: relative; margin: 0; min-height: 365px; background: #b5ca8c }
.welcome-art img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 51% 47% }
.library-bar { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; padding: 33px 0 13px }
.library-bar h2 { font-size: clamp(29px, 3.7vw, 51px) }
.library-bar > p { margin: 0; color: var(--muted); font-weight: 700 }
.filters { display: flex; gap: 8px; flex-wrap: wrap }
.filters label { display: grid; gap: 2px; font-size: 12px; font-weight: 850 }
.filters select { border-radius: 8px; padding: 6px 9px; font-size: 14px; min-height: 36px; background: #fffdf7; color: var(--ink); border: 1px solid #c8cdbf }
.library-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 12px; font-size: 14px }
.library-tabs a { padding: 6px 15px; border: 1px solid var(--line) }
.library-tabs a[aria-current] { background: var(--ink); color: var(--paper); border-color: var(--ink) }
.library-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px }
.library-card { text-align: left; display: flex; flex-direction: column; background: #fffdf7; border: 1px solid var(--line); border-radius: 16px; padding: 0; overflow: hidden }
.library-card:hover { border-color: #52725f; box-shadow: 0 7px 15px #183f3412 }
.card-art { width: 100%; height: auto; aspect-ratio: 1.68; object-fit: cover; display: block; background: #f7e9cb; object-position: center 38% }
.library-card:nth-child(2n) .card-art { background: #f2e9d9 }
.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 3px; flex: 1 }
.card-kind { color: #4f6557; font-weight: 850; font-size: 12px }
.card-title { font-weight: 950; font-size: clamp(18px, 1.7vw, 24px); line-height: 1.09; letter-spacing: -.035em }
.card-desc { color: var(--muted); font-size: 14px; margin-bottom: 5px }
.card-meta { font-weight: 750; color: #4d6557; font-size: 12px; margin-top: auto }
#explore { margin: 14px 0 34px; scroll-margin-top: 8px }
#family-map .wb-map-stage { border-radius: 19px }
.region-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -12px }
.region-links button { font-size: 13px; padding: 6px 11px; background: #fffdf7; border: 1px solid var(--line); border-radius: 20px; min-height: 36px }
.region-links button:hover { background: var(--mint) }
footer { background: #e9edda; padding: 19px 0 }
footer .frame { display: flex; align-items: center; justify-content: space-between; gap: 10px }
footer .brand, footer span { font-size: 15px }
footer .brand-mark { width: 30px; height: 30px; font-size: 17px }
#family-detail { border: 1px solid #b6c5b6; background: var(--paper); color: var(--ink); padding: 0; width: min(780px, 93vw); max-height: 92dvh; border-radius: 22px; overflow: auto }
dialog::backdrop { background: #102a22b8 }
.detail-top { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line) }
.detail-top h2 { font-size: clamp(25px, 4vw, 42px); line-height: 1.13 }
#detail-content { padding: 20px }
.watch-layout, .book-layout { display: grid; grid-template-columns: minmax(160px, .9fr) minmax(0, 1fr); gap: 18px; align-items: center }
.watch-layout video { display: block; width: 100%; max-height: 61dvh; background: #18352b; border-radius: 12px; aspect-ratio: 9 / 16 }
.detail-note { margin-top: 0; font-weight: 750; color: var(--muted) }
.dialog-links { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 12px }
.book-art { width: 100%; border-radius: 12px; aspect-ratio: 1; object-fit: cover; object-position: center 61%; background: #e6edcf }
.book-turns { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px }
.book-text { font-size: clamp(19px, 3.5vw, 30px); font-weight: 800; line-height: 1.25; letter-spacing: -.025em }
.animals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 14px 0 }
.animal { text-align: center; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; padding: 0; background: #fffdf7 }
button.animal:hover { border-color: var(--ink); background: var(--mint) }
.animal img { display: block; aspect-ratio: 1; object-fit: cover; object-position: center top; width: 100% }
.animal strong { display: block; padding: 8px; font-size: clamp(13px, 3.2vw, 21px) }
.game-message { font-weight: 850; min-height: 1.5em }
.activity-note { padding: 13px 16px; border-radius: 12px; background: #edf2df; margin-top: 17px }
.activity-note p { margin: 6px 0 0 }
@media(max-width: 850px) {
  .welcome { grid-template-columns: .95fr 1.05fr }
  .welcome-art { min-height: 340px }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media(max-width: 620px) {
  .frame { width: 92vw }
  .site-nav { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 9px 0 }
  .site-nav nav { grid-row: 2; grid-column: 1 / -1; justify-content: start; gap: 1px }
  nav a { padding: 6px 13px }
  .welcome { margin-top: 16px; grid-template-columns: 1fr; border-radius: 17px }
  .welcome-art { order: -1; min-height: 0; aspect-ratio: 1.85 }
  .welcome-copy { padding: 17px 19px 19px }
  .welcome h1 br { display: none }
  .welcome-actions { margin: 14px 0 12px; gap: 10px }
  .library-bar { padding-top: 24px }
  .filters { display: grid; grid-template-columns: .95fr 1.13fr 1fr; width: 100% }
  .filters select { width: 100%; min-width: 0; padding-inline: 6px }
  .library-grid { gap: 9px }
  .card-body { padding: 10px }
  .detail-top { padding: 13px }
  #detail-content { padding: 13px }
  .watch-layout, .book-layout { grid-template-columns: minmax(0, 1fr); gap: 13px }
  .watch-layout video { max-height: 48dvh }
}
@media print {
  body:has(dialog[open] .print-sheet) > :not(dialog) { display: none !important }
  #family-detail:has(.print-sheet) { position: static; width: 100%; max-width: none; max-height: none; border: 0; overflow: visible }
  #family-detail::backdrop { display: none }
  #family-detail :is(button, .kicker) { display: none }
  .animal { break-inside: avoid }
}
