/* Birdy Branch: screens (start, menu, level select, game HUD). Portrait and landscape (body.land = width >= 1.05 x height),\r
   composition always centered. Sizes taken from the designs 01, 02, 03, 05, 13, 14 and 15. */

/* ---- cats on a cloud (start and menu): feet on the cloud line, they breathe from the feet ---- */
.perch {
  --pw: calc(var(--u) * 90);
  --cs: calc(var(--u) * 17.6);
  --ch: calc(var(--pw) * 0.1826);
  position: relative;
  flex: none;
  width: var(--pw);
  height: calc(var(--cs) * 0.98 + var(--ch) * 0.68);
}
.perch .cloud {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: var(--ch);
}
.perch .cats {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--ch) * 0.68 - var(--cs) * 0.023);
  display: flex;
  justify-content: center;
}
.perch .cat {
  position: relative;
  width: var(--cs);
  height: var(--cs);
  margin: 0 calc(var(--cs) * -0.05);
  transform-origin: 50% 97.6%;
  animation: breathe 3s ease-in-out infinite;
  pointer-events: auto;
}
.perch .cat img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.perch .cat[data-cat='swallow'] img {
  top: 12.1%;
} /* swallow: the tail goes past the feet (FEET in src/config.js) */
.perch .cat.boing {
  animation:
    boing 0.45s var(--pop),
    breathe 3s ease-in-out 0.45s infinite;
}
@keyframes breathe {
  0%,
  100% {
    scale: 1 1;
  }
  50% {
    scale: 1.012 1.028;
  }
}
@keyframes boing {
  0% {
    scale: 1.06 0.93;
  }
  45% {
    scale: 0.96 1.06;
  }
  100% {
    scale: 1 1;
  }
}
body.reduced .perch .cat {
  animation: none;
}
.perch.big {
  --pw: calc(var(--u) * 94);
  --cs: calc(var(--u) * 31);
}
.perch.big .cat {
  margin: 0 calc(var(--cs) * -0.06);
}

/* ---- balloon with the cat on the white disc (same cut as the scene: src/render/scene.js) ---- */
.balloon {
  --bw: calc(var(--u) * 22);
  position: relative;
  width: var(--bw);
  aspect-ratio: 421 / 640;
  flex: none;
  pointer-events: none;
  animation: sway 4s ease-in-out infinite;
  transform-origin: 50% 100%;
}
.balloon .bimg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.balloon .disc {
  position: absolute;
  left: 28.4%;
  top: 63.6%;
  width: 43%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
} /* nest disc: FEEL.balloonDisc */
.balloon .disc img {
  position: absolute;
  width: 115%;
  left: -7.5%;
  top: -7.5%;
}
@keyframes sway {
  0%,
  100% {
    rotate: -1.2deg;
    translate: 0 0;
  }
  50% {
    rotate: 1.2deg;
    translate: 0 calc(var(--u) * -0.8);
  }
}
body.reduced .balloon {
  animation: none;
}

.logo {
  display: block;
  flex: none;
  width: calc(var(--u) * 60);
  aspect-ratio: 937 / 611;
  filter: drop-shadow(0 calc(var(--u) * 0.5) calc(var(--u) * 0.6) rgba(36, 96, 26, 0.3));
}

/* portrait: the composition is ~168u tall (174 with margin): in a nearly square window 1% of the shorter side does not fit and the Play button went off\r
   screen. Here the unit also looks at the height (only on these screens; the corner buttons follow the general unit). */
:root {
  --vh1: 1vh;
}
@supports (height: 1dvh) {
  :root {
    --vh1: 1dvh;
  }
}
/* 1.86: leaves ~9% below the last button; on a phone the browser bar touched it */
body:not(.land) :is(#s-start, #s-menu, #s-map) {
  --u: min(1vmin, 11px, var(--vh1) / 1.86);
}

/* ---- Start ---- */
#s-start {
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  padding-top: calc(var(--sat) + var(--u) * 6);
  padding-bottom: calc(var(--sab) + var(--u) * 16);
  cursor: pointer;
}
.tap {
  font-size: calc(var(--u) * 7);
}
.tap .lbl {
  display: block;
  animation: tap-pulse 2.4s ease-in-out infinite;
}
@keyframes tap-pulse {
  0%,
  100% {
    scale: 1;
  }
  50% {
    scale: 1.05;
  }
} /* only breathes: nothing blinks */
body.reduced .tap .lbl {
  animation: none;
}
body.land #s-start {
  padding-top: calc(var(--sat) + var(--u) * 4);
  padding-bottom: calc(var(--sab) + var(--u) * 3);
}
body.land #s-start .logo {
  width: calc(var(--u) * 50);
}
body.land #s-start .perch {
  --pw: calc(var(--u) * 78);
  --cs: calc(var(--u) * 25);
}
body.land .tap {
  font-size: calc(var(--u) * 5.6);
}

/* ---- Menu ---- */
/* portrait: positions of design 02 (177.7u tall); the spare height of longer screens goes 40% on top */
#s-menu {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: calc(var(--sat) + var(--u) * 9 + max(0px, var(--vh1) * 100 - var(--u) * 177.7) * 0.4);
}
#s-menu .perch {
  margin-top: calc(var(--u) * 28);
}
#s-menu .menu-btns {
  margin-top: calc(var(--u) * 7.2);
}
.menu-head {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}
#s-menu .logo {
  width: calc(var(--u) * 52);
  margin-right: calc(var(--u) * 6);
}
#menu-balloon {
  position: absolute;
  left: calc(50% + var(--u) * 17.5);
  top: 52%;
  --bw: calc(var(--u) * 23);
}
.menu-btns {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 3.4);
}
.menu-btns .pair {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 2.8);
}
.menu-btns .pair .pb {
  --h: calc(var(--u) * 13);
  --w: calc(var(--u) * 51);
  --wmax: calc(var(--u) * 70);
}
#b-play {
  --h: calc(var(--u) * 27.6);
  --w: calc(var(--u) * 59);
  --wmax: calc(var(--u) * 80);
  --cw: calc(var(--h) * 0.42);
}
#b-play .face {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.02;
  --fy: calc(var(--h) * -0.05);
}
#b-play b {
  font-weight: 600;
  font-size: calc(var(--u) * 12);
}
#b-play small {
  font-size: calc(var(--u) * 5);
}
body.land #s-menu {
  padding-top: calc(var(--sat) + var(--u) * 3);
  padding-bottom: calc(var(--sab) + var(--u) * 4);
  justify-content: center;
  gap: calc(var(--u) * 2.2);
}
body.land #menu-balloon {
  display: none;
}
body.land #s-menu .logo {
  width: calc(var(--u) * 40);
  margin: 0;
}
body.land #s-menu .perch {
  --pw: calc(var(--u) * 88);
  --cs: calc(var(--u) * 16);
  margin-top: 0;
}
body.land #s-menu .menu-btns {
  margin-top: 0;
}
body.land .menu-btns {
  gap: calc(var(--u) * 2.6);
}
body.land .menu-btns .pair {
  flex-direction: row;
  gap: calc(var(--u) * 5.2);
}
body.land .menu-btns .pair .pb {
  --h: calc(var(--u) * 8.6);
  --w: calc(var(--u) * 31);
  --wmax: calc(var(--u) * 46);
}
body.land #b-play {
  --h: calc(var(--u) * 17.6);
  --w: calc(var(--u) * 48);
}
body.land #b-play b {
  font-size: calc(var(--u) * 7.4);
}
body.land #b-play small {
  font-size: calc(var(--u) * 3.6);
}

/* ---- Level select: grid of 10 little clouds (2 x 5) per world ---- */
/* portrait: positions of design 03 */
#s-map {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: calc(var(--sat) + var(--u) * 15 + max(0px, var(--vh1) * 100 - var(--u) * 177.7) * 0.4);
}
#map-balloon {
  margin-top: calc(var(--u) * 3.8);
}
#map-grid {
  margin-top: calc(var(--u) * 9.2);
}
#map-stars {
  margin-top: calc(var(--u) * 9.9);
}
#b-back {
  position: absolute;
  z-index: 5;
  top: calc(var(--sat) + var(--u) * 1.6);
  left: calc(var(--sal) + var(--u) * 2.4);
}
.map-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 2.6);
}
.map-head {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 1);
}
.map-head .arrow {
  --s: max(44px, calc(var(--u) * 9.4));
}
.wpill {
  --h: calc(var(--u) * 8.6);
  min-width: calc(var(--u) * 40);
  max-width: calc(var(--u) * 56);
}
.wpill .face {
  font-size: calc(var(--h) * 0.56);
}
#map-dots {
  display: flex;
  gap: calc(var(--u) * 1.8);
} /* 10 worlds: fit on one line at 360 px */
.mdot {
  width: max(18px, calc(var(--u) * 2.8));
  height: max(18px, calc(var(--u) * 2.8));
}
.mdot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
}
.mdot.on::before {
  background: #fff;
  box-shadow: 0 calc(var(--u) * 0.3) calc(var(--u) * 0.5) rgba(36, 96, 26, 0.3);
}
/* invisible touch area: 44 px tall and the width of the spacing (dot + gap), without invading the neighbor */
.mdot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: calc(100% + var(--u) * 1.8);
  height: 44px;
}
#map-balloon {
  --bw: calc(var(--u) * 26);
}
#map-grid {
  --tw: calc(var(--u) * 19.6);
  --gap: calc(var(--u) * -0.6);
  --rg: calc(var(--u) * 11);
  display: grid;
  grid-template-columns: repeat(5, var(--tw));
  column-gap: var(--gap);
  row-gap: var(--rg);
}
.tile {
  width: var(--tw);
  aspect-ratio: 346 / 274;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-left: 0;
} /* Birdy Branch: symmetric plate (green face centred in the file), no spine; the number sits in the middle of the plate */
.tile > img.art {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.tile.cur > img.art {
  width: 112.1%;
  height: 113.9%;
  left: -6.05%;
  top: -5.5%;
} /* art with glow: bigger, same center */
.tile.locked > img.art {
  width: 101.2%;
  height: 99.6%;
  left: -0.6%;
  top: 0.2%;
}
.tile .face {
  position: relative;
  font-size: calc(var(--tw) * 0.33);
  line-height: 1;
  color: #fff;
  text-shadow: 0 0.05em 0 rgba(24, 70, 18, 0.45);
}
.tile.locked .face {
  color: rgba(255, 255, 255, 0.78);
  margin-top: 9%;
}
.tile .st {
  position: relative;
  display: flex;
  gap: 2%;
  height: calc(var(--tw) * 0.17);
  margin-top: 3%;
}
.tile .st img {
  height: 100%;
}
.tile .lk {
  position: relative;
  height: calc(var(--tw) * 0.2);
  margin-top: 3%;
}
.tile .sit {
  position: absolute;
  width: calc(var(--tw) * 0.62);
  left: 19%;
  bottom: 74%;
  pointer-events: none;
}
.tile .sit[src*='swallow-'] {
  transform: translateY(12.1%);
} /* swallow: feet on the plate, the tail goes past */
.tile.locked {
  cursor: default;
}
.tile.bloom {
  animation: bloom 0.6s var(--pop) 0.3s both;
}
@keyframes bloom {
  from {
    scale: 0.6;
  }
}
.tile.no {
  animation: no 0.32s;
}
@keyframes no {
  25% {
    translate: calc(var(--u) * -0.8) 0;
  }
  75% {
    translate: calc(var(--u) * 0.8) 0;
  }
}
#map-stars {
  --h: calc(var(--u) * 9);
  min-width: calc(var(--u) * 35);
}
#map-stars .face {
  font-size: calc(var(--h) * 0.5);
}
body.land #s-map {
  justify-content: space-between;
  padding-top: calc(var(--sat) + var(--u) * 8.5);
  padding-bottom: calc(var(--sab) + var(--u) * 6.5);
}
body.land .map-top {
  z-index: 1;
  position: absolute;
  top: calc(var(--sat) + var(--u) * 8.7);
  left: 50%;
  translate: -50% 0;
  gap: calc(var(--u) * 1.6);
}
body.land #map-balloon {
  margin-top: 0;
  position: absolute;
  --bw: calc(var(--u) * 16);
  top: calc(var(--sat) + var(--u) * 3.4);
  left: calc(50% + var(--u) * 35.6);
}
/* narrow landscape (1024x768, 800x600, 4:3): there is no room between the world title and the corner (sound, gear); the balloon\r
   covered the buttons. With no room, it goes away, like the landscape menu balloon. Rule: disappears if width < 152u. */
@media (max-aspect-ratio: 38/25) and (max-width: 1672px) {
  body.land #map-balloon {
    display: none;
  }
}
body.land #map-grid {
  --tw: calc(var(--u) * 23.4);
  --gap: calc(var(--u) * 1.2);
  --rg: calc(var(--u) * 9.5);
  margin-top: calc(var(--u) * 20);
}
body.land #map-stars {
  margin-top: 0;
  --h: calc(var(--u) * 7.9);
  min-width: calc(var(--u) * 30);
}

/* ---- Game: HUD ---- */
#hud {
  position: absolute;
  top: calc(var(--sat) + var(--u) * 1.6 + (var(--corner) - var(--h)) / 2);
  left: calc(var(--sal) + var(--u) * 3);
  display: flex;
  gap: calc(var(--u) * 1.4);
  --h: max(32px, calc(var(--u) * 6.6));
}
#hud .plate {
  --h: inherit;
}
#hud .plate .face {
  font-size: calc(var(--h) * 0.56);
}
/* the HUD ends before the corner (pause, sound, gear): the level plate shrinks and fit.js reduces the letter; the counter\r
   never shrinks nor gets covered (long level labels in 360) */
#hud {
  max-width: calc(
    100% - var(--sal) - var(--u) * 3 - var(--sar) - var(--u) * 2.4 - var(--corner) * 3 - var(--u) * 3.2 - var(--u) * 1.4
  );
} /* cap, not width: the HUD stays the size of the text (scene.resize reads hud.right) */
#hud-level {
  min-width: calc(var(--u) * 24.5);
  flex: 0 1 auto;
}
#hud-count {
  flex: none;
}
#hud-count.punch {
  animation: punch 0.35s var(--pop);
}
@keyframes punch {
  0% {
    scale: 1.25;
  }
  100% {
    scale: 1;
  }
}
#helps {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  bottom: calc(var(--sab) + var(--u) * 2.4);
  display: flex;
  gap: calc(var(--u) * 6.8);
}
body.land #helps {
  gap: calc(var(--u) * 6.4);
}
/* narrow screen (360): the two values stay side by side without reaching the sound corner */
@media (max-width: 380px) {
  #hud {
    gap: 4px;
  }
  #hud .plate {
    --cw: calc(var(--h) * 0.36);
  }
}

/* ---- screen juice (src/ui/juice.js) ---- */
#hud-level.punch {
  animation: punch 0.35s var(--pop);
}
#combo-badge {
  position: fixed;
  z-index: 4;
  translate: -50% 0;
  padding: 0.1em 0.55em 0.16em;
  border-radius: 999px;
  background: var(--c, #5cb83a);
  font-size: max(16px, calc(var(--u) * 4.6));
  line-height: 1.1;
  text-shadow: var(--shadow);
  box-shadow: 0 calc(var(--u) * 0.5) 0 rgba(24, 70, 18, 0.3);
  pointer-events: none;
}
#combo-badge.go {
  animation:
    badge-in 0.4s var(--pop),
    sway-s 1.2s ease-in-out 0.4s infinite;
}
@keyframes badge-in {
  from {
    scale: 0.3;
  }
}
@keyframes sway-s {
  50% {
    rotate: 6deg;
  }
}
.float {
  position: absolute;
  z-index: 4;
  translate: -50% -50%;
  font-size: max(20px, calc(var(--u) * 7));
  pointer-events: none;
  animation: float-up 1.3s ease-out forwards;
}
.float.praise {
  color: #fff6a8;
}
@keyframes float-up {
  0% {
    opacity: 0;
    scale: 0.6;
  }
  18% {
    opacity: 1;
    scale: 1.06;
  }
  30% {
    scale: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    translate: -50% calc(-50% - var(--u) * 9);
  }
}
/* world announcement: the world balloon comes down from the top holding the straight banner, pauses for a moment and goes up. Stays in the top third,\r
   opaque and without blocking touch; the banner is the same as the panels' (text in the center by the same mechanism). */
#world-banner {
  position: fixed;
  z-index: 4;
  left: 50%;
  top: calc(var(--sat) + var(--corner) + var(--u) * 4);
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
#world-banner .balloon {
  --bw: calc(var(--u) * 30);
  animation: none;
}
/* soft light behind: separates the announcement from the request balloons below it */
#world-banner::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 42%;
  width: calc(var(--u) * 78);
  aspect-ratio: 1;
  translate: -50% -50%;
  background: url(../assets/fx/glow.webp) center / contain no-repeat;
  opacity: 0.85;
}
#world-banner .ribbon {
  --h: calc(var(--u) * 13);
  width: auto;
  min-width: calc(var(--u) * 58);
  margin-top: calc(var(--u) * -2);
  filter: drop-shadow(0 calc(var(--u) * 0.8) calc(var(--u) * 1) rgba(24, 70, 18, 0.3));
}
body.land #world-banner .balloon {
  --bw: calc(var(--u) * 22);
}
body.land #world-banner .ribbon {
  --h: calc(var(--u) * 11);
  min-width: calc(var(--u) * 50);
}
#world-banner.go {
  animation: banner-pass 2.4s both;
}
@keyframes banner-pass {
  0% {
    translate: -50% -120vh;
    animation-timing-function: cubic-bezier(0.2, 0.9, 0.3, 1.12);
  }
  26% {
    translate: -50% 0;
  }
  74% {
    translate: -50% 0;
    animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4);
  }
  100% {
    translate: -50% -120vh;
  }
}
#world-banner.fade {
  animation: banner-fade 1.6s both;
}
@keyframes banner-fade {
  0%,
  100% {
    opacity: 0;
  }
  15%,
  85% {
    opacity: 1;
  }
}
.hb.nudge {
  animation: nudge 5s ease-in-out infinite;
}
@keyframes nudge {
  0%,
  16%,
  100% {
    scale: 1;
  }
  8% {
    scale: 1.04;
  }
}
.badge.spin {
  animation: spin 0.45s var(--pop);
}
@keyframes spin {
  from {
    rotate: -360deg;
    scale: 1.3;
  }
}
/* End of css/screens.css (complete file). */
