/* Floating storybook age picker: live circular buttons above a decorative island. */
#stages.stage-section.wrap {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.stage-gateway {
  position: relative;
  isolation: isolate;
  padding: 35px 38px 103px;
  border-radius: 48% 48% 36px 36px / 35px 35px 36px 36px;
  background: radial-gradient(ellipse at 50% 45%, #effefff5 10%, #e8fbfff2 58%, #dcf6ed90 78%, transparent 100%);
}
.stage-gateway-art {
  position: absolute;
  z-index: 0;
  width: 100%;
  max-width: none;
  height: auto;
  left: 0;
  bottom: -12px;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 9px 7px #2b614b24);
}
#stages .stage-gateway .section-top {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  text-align: center;
}
.stage-gateway .section-kicker {
  display: inline-block;
  padding: 5px 15px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #f4eaffd9;
  color: #7f58a5;
  font-family: var(--font-play);
  font-size: 15px;
  font-weight: 400;
}
#stages .section-top h2 {
  color: #426b9c;
  font-family: var(--font-play);
  font-size: clamp(29px, 3.2vw, 39px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
}
#stages .section-top > p { padding: 0; color: #537284; font-size: 14px; line-height: 1.8; }
#stages .stage-picker {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 21px;
  padding: 10px 0 17px;
}
#stages .stage-button {
  --orb-light: #f3e7ff;
  --orb-color: #dbb9fa;
  --orb-shadow: #b38acd;
  --orb-ink: #6d438e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 3px;
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
  padding: 12px 9px 15px;
  border: 4px solid #ffffffd9;
  border-radius: 50%;
  background: radial-gradient(ellipse at 35% 16%, #ffffffad, transparent 58%), linear-gradient(155deg, var(--orb-light), var(--orb-color));
  box-shadow: inset 0 2px 0 #fff, inset 0 -6px 10px #ffffff25, 0 5px 0 var(--orb-shadow), 0 12px 19px #657f9a20;
  color: var(--orb-ink);
  text-align: center;
  outline: none;
  transform: none;
  transition: transform .2s, outline-color .2s, box-shadow .2s;
}
#stages .stage-button:nth-child(2) { --orb-light: #fff5cd; --orb-color: #ffe09b; --orb-shadow: #d8b46b; --orb-ink: #815c25; }
#stages .stage-button:nth-child(3) { --orb-light: #e3fff0; --orb-color: #b3e9cb; --orb-shadow: #86bd9a; --orb-ink: #376f56; }
#stages .stage-button:nth-child(4) { --orb-light: #e5f6ff; --orb-color: #b8ddfa; --orb-shadow: #89b9d9; --orb-ink: #3d668d; }
#stages .stage-button:nth-child(5) { --orb-light: #ffecf3; --orb-color: #f8c2d8; --orb-shadow: #d39bb2; --orb-ink: #8b4967; }
#stages .stage-button .stage-icon {
  display: block;
  flex-shrink: 0;
  width: clamp(78px, 8.8vw, 108px);
  height: clamp(78px, 8.8vw, 108px);
  margin-top: -12px;
  background: none;
  transform: translateY(-3px);
  filter: drop-shadow(0 5px 3px #45516a28);
}
#stages .stage-button .stage-icon .animal-sprite { display: block; width: 100%; height: 100%; }
#stages .stage-button > span:last-child { display: block; }
#stages .stage-button strong {
  display: block;
  color: var(--orb-ink);
  font-family: var(--font-play);
  font-size: clamp(17px, 1.8vw, 23px);
  font-weight: 500;
  line-height: 1.3;
}
#stages .stage-button small { display: block; margin-top: 3px; color: #4f6176; font-size: 10px; line-height: 1.5; }
#stages .stage-button:hover { transform: translateY(-5px) scale(1.025); }
#stages .stage-button:active { transform: translateY(1px) scale(.98); }
#stages .stage-button.active {
  outline: 3px solid #a56ad6;
  outline-offset: 5px;
  transform: translateY(-4px);
  box-shadow: inset 0 2px 0 #fff, 0 5px 0 var(--orb-shadow), 0 13px 24px #8968ad25;
}
#stages .stage-button.active::after {
  content: "✓";
  position: absolute;
  top: 7px;
  left: 9px;
  width: 27px;
  height: 27px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #9c62cb;
  color: #fff;
  font-size: 19px;
  line-height: 23px;
  text-align: center;
  box-shadow: 0 2px 5px #6e40982b;
}
#stages .stage-button:focus-visible { outline: 3px solid #364d8c; outline-offset: 7px; }
#stages > .learning-path {
  margin-top: 26px;
  padding: 26px 30px;
  border: 1px solid #fff;
  border-radius: 30px;
  background: #f7fcfff0;
  box-shadow: 0 5px 18px #416b7a12;
}
#stages > .return-to-game { margin-inline: 12px; }
@media (max-width: 1050px) {
  .stage-gateway { padding: 30px 38px 83px; }
  #stages .stage-picker { max-width: 650px; margin-inline: auto; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; }
  #stages .stage-button { grid-column: span 2; }
  #stages .stage-button:nth-child(4) { grid-column: 2 / span 2; }
  #stages .stage-button:nth-child(5) { grid-column: 4 / span 2; }
  #stages .stage-button .stage-icon { width: 105px; height: 105px; }
  #stages .stage-button strong { font-size: 21px; }
}
@media (max-width: 760px) {
  .stage-gateway { padding: 25px 17px 68px; }
  #stages .stage-gateway .section-top { gap: 8px; margin-bottom: 21px; }
  .stage-gateway .section-kicker { font-size: 14px; margin-bottom: 8px; }
  #stages .section-top h2 { font-size: 31px; }
  #stages .section-top > p { max-width: 260px; font-size: 12px; line-height: 1.8; }
  #stages .stage-picker { max-width: 420px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 23px 19px; padding-bottom: 12px; }
  #stages .stage-button:nth-child(n) { grid-column: auto; padding: 12px 6px 15px; }
  #stages .stage-button:last-child { grid-column: 1 / -1; justify-self: center; width: calc((100% - 19px) / 2); }
  #stages .stage-button .stage-icon { width: clamp(76px, 24vw, 105px); height: clamp(76px, 24vw, 105px); margin-top: -11px; }
  #stages .stage-button strong { font-size: 20px; }
  #stages .stage-button small { font-size: 9px; }
  #stages .stage-button.active { outline-offset: 4px; }
  #stages .stage-button.active::after { width: 24px; height: 24px; font-size: 17px; line-height: 20px; top: 5px; left: 5px; }
  #stages > .learning-path { margin-top: 19px; padding: 23px 17px; border-radius: 25px; }
}
@media (max-width: 350px) {
  .stage-gateway { padding-inline: 12px; }
  #stages .stage-picker { column-gap: 15px; }
  #stages .stage-button:last-child { width: calc((100% - 15px) / 2); }
  #stages .stage-button:nth-child(n) { padding: 7px 3px 8px; }
  #stages .stage-button strong { font-size: 17px; }
  #stages .stage-button small { font-size: 8px; }
  #stages .stage-button .stage-icon { width: 74px; height: 74px; }
}
@media (prefers-reduced-motion: reduce) {
  #stages .stage-button { transition: none; }
  #stages .stage-button:hover { transform: none; }
}
