#animal-scene.forest-scene {
  z-index: 1;
  pointer-events: none;
}
.forest-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.bird-grove {
  position: absolute;
  width: min(680px, 94%);
  height: 310px;
  left: 50%;
  transform: translateX(-50%);
}
.part-birds {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  column-gap: 80px;
  padding: 0 85px;
}
.bird-perch {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-direction: column;
  position: relative;
}
.bird-character {
  pointer-events: auto;
  background: none;
  width: 112px;
  height: 120px;
  padding: 0;
  transform-origin: 50% 88%;
  position: relative;
  z-index: 2;
}
.bird-character svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.bird-character:disabled {
  opacity: 1;
}
.bird-body {
  transform-origin: 70px 128px;
}
.surprise-eyes {
  display: none;
}
.surprised .calm-eyes {
  display: none;
}
.surprised .surprise-eyes {
  display: block;
}
.wing {
  transform-box: fill-box;
  transform-origin: 50% 10%;
}
.flying .left-wing {
  animation: flap-left 0.16s ease-in-out infinite alternate;
}
.flying .right-wing {
  animation: flap-right 0.16s ease-in-out infinite alternate;
}
@keyframes flap-left {
  to {
    transform: rotate(100deg);
  }
}
@keyframes flap-right {
  to {
    transform: rotate(-100deg);
  }
}
.forest-scene .animal-part {
  pointer-events: auto;
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  width: 44px;
  height: 28px;
  min-height: 28px;
  font-size: 12px;
  margin-top: 3px;
  background: #fffdf3e8;
  z-index: 3;
}
.branch {
  position: absolute;
  left: 0;
  width: 90%;
  height: 17px;
  border-radius: 70% 30% 50% 40%;
  background: #9b7857;
  transform: rotate(-2deg);
  top: 110px;
  box-shadow: 0 4px #7f61461c;
}
.branch-bottom {
  top: 265px;
  left: 10%;
  transform: rotate(2deg);
}
.branch:before,
.branch:after {
  content: '';
  position: absolute;
  width: 32px;
  height: 15px;
  background: #83a477;
  border-radius: 0 90% 0 90%;
  left: 4%;
  top: -12px;
  transform: rotate(-25deg);
}
.branch:after {
  left: 91%;
  transform: rotate(30deg);
}
.guest-bird {
  position: absolute;
  width: 66px;
  height: 72px;
  transform-origin: 50% 90%;
  left: 0;
  top: 35px;
}
.guest-bird:nth-child(2) {
  left: auto;
  right: 0;
  top: 45px;
}
.guest-bird:nth-child(3) {
  left: 5%;
  top: 200px;
}
.guest-bird:nth-child(4) {
  left: auto;
  right: 3%;
  top: 205px;
}
.guest-bird svg {
  width: 100%;
  height: 100%;
}
.guest-birds {
  pointer-events: none;
}
.prompt {
  z-index: 3;
}
.hero {
  z-index: 3;
}
.home-bottom {
  z-index: 4;
}
@media (max-width: 600px) {
  .bird-grove {
    height: 270px;
    width: 94%;
  }
  .part-birds {
    column-gap: 35px;
    padding: 0 34px;
  }
  .bird-character {
    width: 96px;
    height: 104px;
  }
  .branch {
    top: 94px;
  }
  .branch-bottom {
    top: 229px;
  }
  .guest-bird {
    width: 45px;
    height: 52px;
  }
  .guest-bird:nth-child(3),
  .guest-bird:nth-child(4) {
    top: 185px;
  }
}
@media (max-height: 650px) {
  .bird-grove {
    height: 160px;
    width: min(650px, 90%);
  }
  .part-birds {
    display: flex;
    padding: 0;
    gap: 15px;
    justify-content: space-evenly;
    align-items: flex-end;
  }
  .bird-character {
    width: 80px;
    height: 88px;
  }
  .branch {
    top: 125px;
    width: 100%;
  }
  .branch-bottom {
    display: none;
  }
  .forest-scene .animal-part {
    height: 26px;
    min-height: 26px;
  }
  .prompt h1 {
    font-size: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .flying .wing {
    animation: none;
  }
}
.forest-scene .animal-part.learned {
  background: #365b48;
  color: #fffdf3;
}
@font-face {
  font-family: Nunito;
  src: url('./fonts/nunito.ttf') format('truetype');
  font-weight: 200 1000;
  font-display: swap;
}
:root {
  font-family: Nunito, 'Trebuchet MS', sans-serif;
  --ink: #365244;
  --muted: #647d69;
}
.wordmark,
.hero h1,
.prompt h1,
.result h2,
.score,
.sheet h2 {
  font-family: Nunito, 'Trebuchet MS', sans-serif;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.hero h1 {
  font-weight: 900;
  letter-spacing: -0.055em;
}
.hero h1 em {
  font-style: normal;
  color: #c68b48;
}
.eyebrow {
  font-weight: 800;
  letter-spacing: 0.14em;
}
.prompt p,
.result p,
.hero p {
  font-weight: 600;
}
.wordmark {
  font-weight: 900;
}
.keyboard {
  background: #a88360;
  border-radius: 24px;
  padding: 10px;
  gap: 5px;
  box-shadow: 0 5px 0 #88684b;
  height: clamp(105px, 18vh, 160px);
}
.key {
  background: #fff6db;
  box-shadow: inset 0 -5px #e7dab5;
  border-radius: 8px 8px 13px 13px;
  color: #8a795b;
  padding-bottom: 13px;
}
.key b {
  font-size: 14px;
  font-weight: 800;
}
.key small {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.6;
}
.key.black:after {
  background: #59745c;
  box-shadow: 0 4px #405a47;
  border-radius: 0 0 9px 9px;
  width: 57%;
  height: 54%;
}
.key.held {
  background: #f4c46e;
  box-shadow: inset 0 -3px #d9a354;
}
.dock {
  background: linear-gradient(transparent, #d6e6d7 50%);
}
.primary {
  background: #59745c;
  color: #fff9e9;
  box-shadow: 0 3px #405a47;
}
.secondary,
.icon {
  background: #fff8e5;
  border: 0;
  backdrop-filter: none;
}
.result {
  background: #fff8e9;
  border: 0;
  box-shadow: none;
}
.sheet,
.sheet header {
  background: #fff8e9;
}
.animal-part {
  box-shadow: none;
}
.forest-scene .animal-part {
  background: #fff8e5;
  font-weight: 800;
}
.forest-scene .animal-part.learned {
  background: #59745c;
}
.dock-note {
  font-size: 12px;
  font-weight: 600;
}
.fine {
  font-weight: 600;
}
@media (max-width: 600px) {
  .keyboard {
    height: 132px;
    padding: 7px;
    gap: 3px;
    border-radius: 18px;
  }
  .key {
    border-radius: 5px 5px 10px 10px;
  }
  .key b {
    font-size: 12px;
  }
  .dock-note {
    font-size: 10px;
  }
  .prompt h1 {
    font-size: 29px;
  }
  .wordmark {
    font-size: 21px;
  }
}
@media (max-height: 600px) {
  .keyboard {
    height: 85px;
  }
  .prompt h1 {
    font-size: 24px;
  }
}
.hero h1 {
  font-size: clamp(44px, 8vw, 88px);
  letter-spacing: -0.05em;
}
.logo-note {
  font-style: normal;
  color: #c68b48;
  font-size: 0.72em;
}
.wordmark {
  white-space: nowrap;
}
@media (max-width: 600px) {
  .hero h1 {
    font-size: clamp(40px, 10vw, 56px);
  }
  .wordmark {
    font-size: 20px;
  }
  .hero {
    top: 17%;
  }
}
.dock,
.prompt {
  transition:
    opacity 1s ease,
    transform 1s cubic-bezier(0.22, 0.61, 0.36, 1);
}
body[data-state='finishing'] .dock {
  pointer-events: none;
}
body[data-finish-phase='fade'] .dock {
  opacity: 0;
  transform: translateY(55px);
}
body[data-finish-phase='fade'] .prompt {
  opacity: 0;
}
.bird-grove {
  transform-origin: 50% 65%;
}
body[data-state='finishing'] .animal-part,
body[data-state='win'] .animal-part {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s;
}
.bird-hint {
  position: absolute;
  bottom: 1px;
  left: calc(50% + 30px);
  pointer-events: auto;
  padding: 5px 9px;
  min-height: 28px;
  border-radius: 16px;
  background: #f5d389;
  color: #624b2b;
  font-size: 12px;
  font-weight: 800;
  z-index: 4;
  animation: hint-appear 0.3s ease-out;
}
.key.hint {
  background: #f3bf61;
  box-shadow:
    inset 0 -5px #dba451,
    inset 0 0 0 3px #c18b39;
}
.key.hint b {
  color: #624b2b;
}
.key.hint:before {
  content: '•';
  position: absolute;
  bottom: 35%;
  font-size: 28px;
  color: #b5752e;
}
@keyframes hint-appear {
  from {
    opacity: 0;
    translate: 0 4px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@media (max-width: 600px) {
  .bird-hint {
    left: calc(50% + 27px);
    padding: 5px 7px;
    font-size: 11px;
  }
}
/* Each face and beak is rigged separately; note timing comes from the audio clock. */
.bird-head {
  transform-origin: 70px 90px;
  transform: rotate(var(--head-lift, 0deg));
  transition: transform 0.22s ease;
}
.profile-face,
.closed-eyes {
  display: none;
}
.singing .front-face {
  display: none;
}
.singing .profile-face {
  display: inline;
}
.singing .right-wing {
  opacity: 0.25;
  transform: scale(0.65);
}
.singing .left-wing {
  transform: rotate(-18deg);
}
.upper-beak,
.lower-beak {
  transform-origin: 112px 64px;
  transform-box: view-box;
}
.upper-beak {
  transform: rotate(calc(var(--beak-open, 0) * -10deg));
}
.lower-beak {
  transform: rotate(calc(var(--beak-open, 0) * 30deg));
}
.beak-mouth {
  opacity: var(--beak-open, 0);
}
.blinking .open-eyes,
.trilling .open-eyes {
  display: none;
}
.blinking .closed-eyes,
.trilling .closed-eyes {
  display: inline;
}
.curious .bird-head {
  transform: rotate(8deg);
}
.curious .pupils {
  translate: 2px -2px;
}
.surprised .open-eyes {
  transform: scaleY(1.15);
  transform-origin: 70px 65px;
}
.surprised .front-beak {
  transform: scale(0.65, 1.4);
  transform-origin: 70px 77px;
}
.bird-character:not(.playing):not(.flying):not(.dancing) .bird-body {
  animation: bird-breathe 3.8s ease-in-out var(--idle-delay, 0s) infinite;
}
.bird-art .wing {
  transform-box: view-box;
  transform-origin: 35px 83px;
  transition: transform 0.15s ease;
}
.bird-art .right-wing {
  transform-origin: 105px 83px;
}
.flying .bird-art .left-wing {
  animation: wing-up 0.22s ease-in-out infinite alternate;
}
.flying .bird-art .right-wing {
  animation: wing-down 0.22s ease-in-out infinite alternate;
}
.dancing .left-wing {
  transform: rotate(35deg);
}
.dancing .right-wing {
  transform: rotate(-35deg);
}
@keyframes wing-up {
  from {
    transform: rotate(-25deg);
  }
  to {
    transform: rotate(115deg);
  }
}
@keyframes wing-down {
  from {
    transform: rotate(25deg);
  }
  to {
    transform: rotate(-115deg);
  }
}
@keyframes bird-breathe {
  50% {
    transform: translateY(1px) scale(1.015, 0.985);
  }
}
@media (prefers-reduced-motion: reduce) {
  .bird-character .bird-body,
  .flying .bird-art .wing {
    animation: none;
  }
  .bird-head {
    transition: none;
  }
}
/* Quiet stage: only the model and controls, without forest scenery. */
body,
#game {
  background: #f1f3ef;
}
.dock {
  background: transparent;
}
.live2d-flock {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.bird-grove {
  z-index: 2;
}
.bird-character {
  width: 150px;
  height: 145px;
  touch-action: none;
}
.guest-bird {
  width: 90px;
  height: 90px;
}
.bird-perch {
  justify-content: flex-end;
}
.bird-grove {
  height: 350px;
}
.forest-scene {
  touch-action: none;
}
.hero p:empty,
.prompt p:empty,
.result p:empty,
.dock-note:empty {
  display: none;
}
.result {
  background: transparent;
}
.prompt #instruction {
  font-size: 26px;
}
.prompt #subtitle {
  font-size: 14px;
}
.hero {
  top: 14%;
}
@media (max-width: 600px) {
  .bird-character {
    width: 122px;
    height: 120px;
  }
  .bird-grove {
    height: 300px;
  }
  .guest-bird {
    width: 55px;
    height: 55px;
  }
  .part-birds {
    column-gap: 28px;
    padding: 0 34px;
  }
  .hero {
    top: 16%;
  }
}
@media (max-height: 650px) {
  .bird-grove {
    height: 150px;
  }
  .bird-character {
    width: 100px;
    height: 95px;
  }
  .prompt #subtitle {
    display: none;
  }
  .prompt #instruction {
    font-size: 22px;
  }
  .hero {
    top: 17%;
  }
}
/* Larger flock sits directly above the keyboard. */
.bird-grove {
  width: min(840px, 96%);
  height: 390px;
}
.part-birds {
  padding: 0 80px;
  column-gap: 45px;
}
.bird-character {
  width: 220px;
  height: 185px;
}
.guest-bird {
  pointer-events: auto;
  touch-action: none;
  width: 105px;
  height: 105px;
}
.guest-birds {
  pointer-events: auto;
}
@media (max-width: 600px) {
  .bird-grove {
    height: 340px;
    width: 100%;
  }
  .part-birds {
    padding: 0 10px;
    column-gap: 0;
  }
  .bird-character {
    width: 165px;
    height: 155px;
  }
  .guest-bird {
    width: 65px;
    height: 65px;
  }
}
@media (max-height: 650px) {
  .bird-grove {
    height: 145px;
    width: min(840px, 98%);
  }
  .part-birds {
    padding: 0;
    gap: 0;
  }
  .bird-character {
    width: 145px;
    height: 120px;
  }
}
@media (max-width: 380px) and (min-height: 651px) {
  .bird-character {
    width: 155px;
    height: 145px;
  }
  .bird-grove {
    height: 320px;
  }
}
.bird-character {
  height: var(--bird-height, 155px);
  width: calc(var(--bird-height, 155px) * 1.15);
  flex-shrink: 0;
}
.part-birds {
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}
/* Layout fits the available stage and staggers each bird without hiding controls. */
.part-birds {
  display: block;
  padding: 0;
}
.bird-perch {
  position: absolute;
}
.bird-character {
  max-width: none;
}
.guest-bird:nth-child(3),
.guest-bird:nth-child(4) {
  top: auto;
  bottom: 60px;
}

body[data-state='home'] .animal-part,
body[data-state='loading'] .animal-part {
  visibility: hidden;
  pointer-events: none;
}
/* Replay sits by the outer shoulder; hints occupy the opposite corner. */
.forest-scene .animal-part {
  position: absolute;
  top: 14%;
  left: 0;
  bottom: auto;
  right: auto;
  width: 36px;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 8px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: none;
}
.forest-scene .animal-part:before {
  content: none;
}
.animal-part svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.bird-hint {
  top: 14%;
  bottom: auto;
  left: auto;
  right: -2px;
  min-height: 32px;
  font-size: 12px;
  padding: 6px 9px;
}
.controls-right .animal-part {
  left: auto;
  right: 0;
}
.controls-right .bird-hint {
  right: auto;
  left: -2px;
}
/* Playback clears this copy, but its slot must not resize the flock. */
.prompt #subtitle,
.prompt #subtitle:empty {
  display: block;
  min-height: 1.5em;
}
@media (max-height: 650px) {
  .prompt #subtitle,
  .prompt #subtitle:empty {
    display: none;
  }
}
.bird-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 12px;
  min-height: 40px;
}
.bird-controls .animal-part {
  position: static;
  inset: auto;
  transform: none;
  width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff8e5;
}
.bird-controls .animal-part:before {
  content: none;
}
.bird-controls .animal-part.learned {
  background: #59745c;
  color: #fff;
}
.sequence-hint {
  background: #f5d389;
  color: #624b2b;
  border-radius: 20px;
  padding: 9px 16px;
  min-height: 40px;
  font-weight: 800;
  font-size: 14px;
}
.bird-controls .animal-part[aria-pressed='true'] {
  outline: 2px solid #577b66;
  outline-offset: 2px;
}
body[data-state='loading'] .bird-controls {
  visibility: hidden;
}
@media (max-height: 650px) {
  .bird-controls {
    margin-bottom: 8px;
    min-height: 32px;
    gap: 8px;
  }
  .bird-controls .animal-part {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 6px;
  }
  .sequence-hint {
    min-height: 32px;
    padding: 5px 12px;
  }
}
.bird-character:focus,
.bird-character:focus-visible {
  outline: none;
  box-shadow: none;
}
body[data-intro='true'] .dock {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
}

.bird-controls {
  width: 100%;
  gap: 8px;
}
.bird-controls .animal-part {
  flex: 1;
  min-width: 0;
  width: auto;
  height: 46px;
  min-height: 46px;
  padding: 8px 4px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}
.bird-controls .animal-part[hidden] {
  display: none;
}
@media (max-width: 420px) {
  .bird-controls {
    gap: 6px;
  }
  .bird-controls .animal-part {
    font-size: 14px;
  }
}

.bird-controls {
  align-items: stretch;
}
.bird-controls .animal-part {
  height: 80px;
  min-height: 80px;
  align-content: center;
  gap: 4px;
  white-space: normal;
}
.part-complete {
  white-space: nowrap;
}
.part-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 5px;
  font-size: 14px;
  line-height: 1.25;
  width: 100%;
  font-weight: 700;
}
.part-notes span {
  white-space: nowrap;
}

/* One white face splash, faded with its Live2D features. */
.transition-bird-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}
.giant-bird {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: none;
  padding: 0;
  touch-action: none;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.75s ease;
  outline: none !important;
}
.transition-bird-layer[data-mode='home'] {
  z-index: 2;
}
.transition-bird-layer[data-mode='cover'],
.transition-bird-layer[data-mode='exit'] {
  pointer-events: auto;
}
.transition-bird-layer[data-mode='below'] .giant-bird,
.transition-bird-layer[data-mode='exit'] .giant-bird {
  opacity: 0;
}
body[data-state='home'] .bird-grove,
body[data-transition='true'] .bird-grove {
  visibility: hidden;
}
body[data-transition] #animal-scene {
  z-index: 7;
}
.transition-bird-layer[hidden] .giant-bird {
  visibility: hidden;
}
body[data-state='home'] .hero {
  top: 12%;
  z-index: 3;
}
body[data-transition] .bird-perch {
  transition:
    left 0.65s ease,
    top 0.65s ease,
    width 0.65s ease,
    height 0.65s ease;
}
body[data-transition] .dock {
  opacity: 0;
  transform: translateY(55px);
  pointer-events: none;
}
body[data-transition] #reward-controls {
  opacity: 0;
  pointer-events: none;
}
body[data-transition] .prompt {
  opacity: 0;
}
.bird-controls .animal-part {
  position: relative;
  overflow: hidden;
}
.part-stage {
  position: absolute;
  inset: 8px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}
.part-stage.check {
  font-size: 28px;
}
.part-stage.out {
  opacity: 0;
  transform: translateY(5px);
}
.part-stage.notes .part-notes {
  font-size: 16px;
}
