/* Shared CSS for ReactBitsKids playful components (rewritten from react-bits-main) */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#stage {
  min-height: 100vh;
}

/* 1. BounceCards (fanned spread hand) */
.rb-bounce-stage {
  position: relative;
  width: 100%;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rb-bounce-card {
  position: absolute;
  left: 50%;
  top: 24px;
  width: 206px;
  padding: 10px 10px 12px;
  border-radius: 20px;
  background: #ffffff;
  border: 2.5px solid #1C3526;
  box-shadow:
    0 6px 0 rgba(28, 53, 38, 0.92),
    0 14px 28px rgba(24, 42, 30, 0.16);
  cursor: pointer;
  transition: transform 240ms cubic-bezier(0.22, 1.25, 0.36, 1), box-shadow 200ms ease-out;
  will-change: transform;
  text-align: center;
  font-family: inherit;
}

.rb-bounce-img-wrap {
  position: relative;
  width: 100%;
  height: 196px;
  border-radius: 12px;
  overflow: hidden;
  background: #F4EFE6;
}

.rb-bounce-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rb-bounce-letter {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #F4B942;
  color: #1A2B22;
  border: 2px solid #1A2B22;
  font-weight: 700;
  font-size: 13px;
  line-height: 24px;
  text-align: center;
}

.rb-bounce-caption {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #1A2B22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 2. Peel / 3D Embroidered Patch Tilt & Corner Curl */
.rb-peel-patch {
  --peel-rx: 0deg;
  --peel-ry: 0deg;
  --peel-gx: 50%;
  --peel-gy: 50%;
  position: relative;
  transform: perspective(650px) rotateX(var(--peel-rx)) rotateY(var(--peel-ry));
  transition: transform 180ms cubic-bezier(0.2, 0, 0, 1);
  will-change: transform;
}

.rb-peel-patch img {
  filter: drop-shadow(0 8px 14px rgba(20, 30, 24, 0.22));
  transition: transform 200ms cubic-bezier(0.22, 1.28, 0.36, 1), filter 200ms ease-out;
}

.rb-peel-patch:hover img {
  transform: translateY(-4px) scale(1.05) rotate(-2deg);
  filter: drop-shadow(0 14px 20px rgba(20, 30, 24, 0.28));
}

/* 3. FolderKit (pop-open Adventure Kit slipcase) */
.rb-folder {
  position: relative;
  width: 300px;
  height: 220px;
  margin: 28px auto 12px;
  cursor: pointer;
  outline: none;
}

.rb-folder-back {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--folder-back, #9F4E2B);
  border-radius: 0 20px 20px 20px;
  box-shadow: 0 14px 30px rgba(24, 24, 27, 0.14);
}

.rb-folder-tab {
  position: absolute;
  top: -26px;
  left: 0;
  height: 28px;
  padding: 0 18px;
  border-radius: 12px 12px 0 0;
  background: var(--folder-back, #9F4E2B);
  color: #FFFDF9;
  font-size: 12px;
  font-weight: 600;
  line-height: 28px;
  white-space: nowrap;
}

.rb-folder-sheets {
  position: absolute;
  inset: 14px 16px 18px;
  pointer-events: none;
}

.rb-folder-sheet {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 158px;
  padding: 8px 8px 10px;
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid rgba(24, 24, 27, 0.12);
  box-shadow: 0 8px 18px rgba(24, 24, 27, 0.14);
  transform: translate3d(-50%, 0, 0) rotate(0deg) scale(0.92);
  transition: transform 260ms cubic-bezier(0.22, 1.25, 0.36, 1);
  text-align: center;
}

.rb-folder-sheet img {
  width: 100%;
  height: 106px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.rb-folder-sheet span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #18181B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rb-folder-sheet-0 { transform: translate3d(-62%, -8px, 0) rotate(-5deg) scale(0.94); z-index: 1; }
.rb-folder-sheet-1 { transform: translate3d(-50%, -14px, 0) rotate(1deg) scale(0.96); z-index: 2; }
.rb-folder-sheet-2 { transform: translate3d(-38%, -6px, 0) rotate(6deg) scale(0.94); z-index: 3; }

.rb-folder.is-open .rb-folder-sheet-0 {
  transform: translate3d(-108%, -66px, 0) rotate(-13deg) scale(1);
}
.rb-folder.is-open .rb-folder-sheet-1 {
  transform: translate3d(-50%, -84px, 0) rotate(0deg) scale(1.04);
}
.rb-folder.is-open .rb-folder-sheet-2 {
  transform: translate3d(8%, -64px, 0) rotate(13deg) scale(1);
}

.rb-folder-front {
  position: absolute;
  inset: auto 0 0 0;
  height: 76%;
  background: var(--folder-front, #C86D44);
  border-radius: 16px 16px 20px 20px;
  transform-origin: bottom center;
  transition: transform 240ms cubic-bezier(0.2, 0, 0, 1);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 18px;
  z-index: 5;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
}

.rb-folder.is-open .rb-folder-front {
  transform: perspective(500px) rotateX(-24deg) scaleY(0.94);
}

.rb-folder-badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.94);
  color: #18181B;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* 4. ReviewStack (flippable postcard deck) */
.rb-stack-stage {
  position: relative;
  height: 256px;
  width: 100%;
}

.rb-stack-card {
  position: absolute;
  inset: 0 0 auto 0;
  min-height: 214px;
  padding: 22px 24px;
  border-radius: 18px;
  background: #FFFFFF;
  border: 1.5px solid rgba(24, 24, 27, 0.12);
  box-shadow:
    0 1px 2px rgba(24, 24, 27, 0.05),
    0 12px 28px rgba(24, 24, 27, 0.09);
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1), opacity 180ms ease-out;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.rb-stack-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rb-stack-stars {
  color: #D98A1C;
  font-size: 15px;
  letter-spacing: 1px;
}

.rb-stack-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: #F1EFEA;
  color: #18181B;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.rb-stack-quote {
  margin: 14px 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: #18181B;
  font-weight: 400;
}

.rb-stack-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: #18181B;
}

.rb-stack-next {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(24, 24, 27, 0.18);
  background: #FAF7F2;
  color: #18181B;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* 6. CircularStamp */
.rb-circular-stamp {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: #FFFDF8;
  border: 2px dashed #1B3B2B;
  box-shadow: 0 6px 16px rgba(25, 38, 31, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rb-circular-ring {
  position: absolute;
  inset: 6px;
  animation: rbSpin 18s linear infinite;
}

.rb-circular-stamp:hover .rb-circular-ring {
  animation-duration: 7s;
}

.rb-circular-ring span {
  position: absolute;
  left: 50%;
  top: 0;
  transform-origin: 0 50px;
  font-size: 10.5px;
  font-weight: 700;
  color: #1B3B2B;
}

.rb-circular-center {
  font-size: 26px;
  line-height: 1;
}

@keyframes rbSpin {
  to { transform: rotate(360deg); }
}

/* 7. RotatingWords */
.rb-rot-char {
  display: inline-block;
  animation: rbPopIn 260ms cubic-bezier(0.22, 1.35, 0.36, 1) both;
}

@keyframes rbPopIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rb-bounce-card,
  .rb-peel-patch,
  .rb-peel-patch img,
  .rb-folder-sheet,
  .rb-folder-front,
  .rb-stack-card {
    transition: none !important;
  }
  .rb-circular-ring,
  .rb-rot-char {
    animation: none !important;
  }
}
