/* Game scene and HUD (game code). Static art = DOM layers, moving things = one canvas, texts = live Fredoka. */
#game-root {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  font-family: var(--font, 'Fredoka', system-ui, sans-serif);
  font-weight: 600;
  --ink: #0f55d6;
  --ink-d: #003b96;
  -webkit-tap-highlight-color: transparent;
}
#game-root img,
#game-root canvas {
  -webkit-user-drag: none;
  user-select: none;
}
#game-root .g-layer {
  position: absolute;
  pointer-events: none;
  display: block;
}
#game-root .g-layer.tray,
#game-root .g-layer.counter {
  z-index: 1;
}
#game-root .g-layer.skirt {
  z-index: 0;
}
#game-root .scene {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  pointer-events: none;
}
#game-root .hud {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

/* buttons: square white face with pink trim, blue icon */
#game-root .gbtn {
  position: absolute;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  outline: none;
  transition:
    transform 160ms cubic-bezier(0.3, 1.7, 0.5, 1),
    opacity 200ms,
    filter 200ms;
  -webkit-appearance: none;
  appearance: none;
}
#game-root .gbtn:active:not(:disabled) {
  transform: scale(0.93);
  transition-duration: 60ms;
}
#game-root .gbtn .gface {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#game-root .gbtn .gico {
  position: absolute;
  left: 21%;
  top: 17%;
  width: 58%;
  height: 58%;
  object-fit: contain;
}
#game-root .gbtn.help .gico {
  left: 18%;
  top: 14%;
  width: 64%;
  height: 64%;
}
#game-root .gbtn .badge {
  position: absolute;
  right: -9%;
  bottom: -9%;
  width: 46%;
  height: 46%;
}
#game-root .gbtn .badge .bface {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#game-root .gbtn .badge .n {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: calc(var(--sq, 56px) * 0.27);
  line-height: 1;
}
#game-root .gbtn.gone {
  visibility: hidden;
}
#game-root .gbtn.empty {
  filter: grayscale(0.9);
  opacity: 0.5;
}
#game-root .gbtn.on {
  transform: scale(1.07);
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.95));
}
#game-root .gbtn.nudge {
  animation: gnudge 1.5s ease-in-out infinite;
}
@keyframes gnudge {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.075);
  }
}

/* plaque + goal bar */
#game-root .plaque {
  position: absolute;
  pointer-events: none;
}
#game-root .pq-bg,
#game-root .hint-bg {
  position: absolute;
  left: 0;
  top: 0;
}
#game-root .lvl {
  position: absolute;
  left: 0;
  right: 0;
  top: 4%;
  height: 40%;
  display: grid;
  place-items: center;
  color: var(--ink-d);
  text-transform: uppercase; /* the label stays in the center of the tab (top gap = gap to the bar) */
  font-size: calc(var(--ph) * 0.26);
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
#game-root .barrow {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 44%;
  height: 44%;
  display: flex;
  align-items: center;
  gap: 5%;
}
#game-root .gbar {
  position: relative;
  flex: 1 1 auto;
  height: 92%;
}
#game-root .track {
  position: absolute;
  left: 0;
  top: 0;
}
#game-root .fillwrap {
  position: absolute;
  overflow: visible;
  transition: clip-path 90ms linear;
}
#game-root .gfill {
  display: block;
  filter: brightness(1.14) saturate(0.82);
} /* the fill art is hotter than the design's: lighter pink so the number reads */
#game-root .num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #082a78;
  font-size: calc(var(--ph) * 0.19);
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 0 0.3em rgba(255, 255, 255, 0.55);
} /* dark navy like the design + a soft halo: readable on the pink fill and on the blue track */
#game-root .gmedal {
  position: relative;
  flex: none;
  width: calc(var(--ph) * 0.56);
  height: calc(var(--ph) * 0.56);
  transform-origin: 50% 60%;
}
#game-root .mface {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#game-root .mico {
  position: absolute;
  left: 10%;
  top: 10%;
  width: 80%;
  height: 80%;
}

/* HUD text: the ink of Fredoka capitals sits a hair above the middle of the box when the grid centers; a single adjustment for all */
#game-root :is(.num, .hint-t, .lvl, .badge .n) {
  translate: 0 0.02em;
}

/* hint pill */
#game-root .hint {
  position: absolute;
  opacity: 0;
  pointer-events: none;
} /* the entrance pop (spring) and the exit belong to src/ui/uifx.js (watchHint) */
#game-root .hint.on {
  opacity: 1;
  pointer-events: auto;
}
#game-root .hint-t {
  font-kerning: none;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: calc(var(--sq, 56px) * 0.33);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

/* panda */
#game-root .panda {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}
#game-root .panda .shadow {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -3%;
  height: 9%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(90, 40, 80, 0.34), rgba(90, 40, 80, 0));
}
#game-root .panda .pbody {
  position: absolute;
  inset: 0;
  transform-origin: 50% 100%;
  animation: gbreathe var(--breathe, 3.4s) ease-in-out infinite;
}
#game-root .panda img {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  opacity: 0;
}
#game-root .panda img.on {
  opacity: 1;
}
#game-root .panda.hype .pbody {
  animation: ghype 0.34s ease-in-out infinite;
}
@keyframes gbreathe {
  0%,
  100% {
    transform: scale(1, 1);
  }
  50% {
    transform: scale(1.008, 1.022);
  }
}
@keyframes ghype {
  0%,
  100% {
    transform: rotate(-1.2deg) scale(1.02);
  }
  50% {
    transform: rotate(1.2deg) scale(1.04);
  }
}
#game-root.calm .panda .pbody,
#game-root.calm .gbtn.nudge {
  animation: none;
}
#game-root.paused * {
  animation-play-state: paused !important;
}

/* floating texts, sparkles, tutorial hand */
#game-root .float {
  position: absolute;
  z-index: 7;
  pointer-events: none;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1;
  transform: translate(-50%, -50%);
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.9),
    0 0 10px rgba(255, 255, 255, 0.85);
  will-change: transform, opacity;
}
/* combo and praise sit on a small white pill, so the pink letters read over the pink rings and the plates (no thick outline on the letters) */
#game-root .float small {
  display: block;
  font-size: 0.58em;
  line-height: 1.05;
  margin-top: 0.12em;
}
#game-root .float.combo,
#game-root .float.praise {
  color: #1763d6;
  text-align: center;
  text-shadow: none;
  padding: 0.2em 0.62em 0.24em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 0.08em rgba(120, 200, 250, 0.8),
    0 0.12em 0.35em rgba(40, 70, 120, 0.25);
}
#game-root .float.combo.hot {
  color: #fff;
  background: linear-gradient(#4cb8fa, #1488dc);
  box-shadow:
    0 0 0 0.08em rgba(255, 255, 255, 0.95),
    0 0 0.6em rgba(60, 170, 250, 0.75),
    0 0.12em 0.35em rgba(40, 70, 120, 0.3);
}
#game-root .sparkle {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  width: calc(var(--p, 60px) * 0.26);
  animation: gspark var(--sd, 1.6s) ease-in-out 1 forwards;
}
@keyframes gspark {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(0);
  }
  45% {
    opacity: 0.9;
    transform: scale(1) rotate(20deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.3) rotate(40deg);
  }
}
#game-root .tuto.ghost {
  z-index: 5;
}
#game-root .tuto {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  width: calc(var(--p, 60px) * 1.5);
  opacity: 0;
  will-change: transform, opacity;
}
/* End of css/game.css (complete file). */
