/* Penny v14.47: "Welcome to Penny's World", meeting Penny and her friends (static/meet-friends.js) */

/* the World Trip's rounded fonts (static/world-trip/fonts) */
@font-face { font-family: "Fredoka"; src: url("/static/world-trip/fonts/fredoka.woff") format("woff"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/static/world-trip/fonts/nunito.woff") format("woff"); font-weight: 200 1000; font-display: swap; }

/* ---- on the grown-up setup screen ---- */
.meet-panel {
  margin: 0 0 20px; padding: 14px 16px 12px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,217,120,.10), rgba(255,255,255,.04));
  border: 1px solid rgba(255,217,120,.28);
}
.meet-panel[hidden] { display: none; }
.meet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.meet-head > div { flex: 1 1 300px; }
.meet-head b { font-size: 17px; }
.meet-head small { display: block; margin-top: 3px; color: #c9d8ea; font-size: 13px; line-height: 1.4; }
.meet-all { background: linear-gradient(135deg, #ffe08a, #ffb8d0) !important; color: #2b2450 !important; border: 0 !important; white-space: nowrap; }
.meet-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.meet-card {
  display: grid; justify-items: center; gap: 2px; padding: 8px 4px 7px; border-radius: 16px; cursor: pointer;
  color: #eff6ff; font: inherit; background: radial-gradient(circle at 50% 38%, rgba(190,225,255,.30), rgba(255,255,255,.05) 70%);
  border: 1px solid rgba(255,255,255,.14); transition: transform .18s ease, border-color .18s ease;
}
.meet-card img { width: 100%; height: 92px; object-fit: contain; pointer-events: none; }
.meet-card span { display: grid; line-height: 1.15; text-align: center; }
.meet-card b { font-size: 14px; }
.meet-card small { font-size: 11px; color: #b9cae0; }
.meet-card i { font-style: normal; font-size: 10.5px; color: #ffd978; margin-top: 2px; }
.meet-card:hover, .meet-card:focus-visible { transform: translateY(-3px); border-color: #ffd978; outline: none; }
.meet-card:hover img { animation: mtHop .56s ease-out; }
.meet-note { margin: 10px 2px 0; color: #b9cae0; font-size: 12.5px; line-height: 1.45; }
.meet-voice-note { margin: 6px 2px 0; color: #ffd978; font-size: 12px; line-height: 1.45; }
.meet-voice-note code { font-size: 11.5px; color: #fff; background: rgba(255,255,255,.12); padding: 1px 5px; border-radius: 6px; }
@media (max-width: 620px) {
  .meet-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .meet-card img { height: 78px; }
}

/* ---- the film ---- */
.meet-theatre {
  position: fixed; inset: 0; z-index: 1400; overflow: hidden; color: #2b3550; background: #bfe7ff;
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
}
.mt-stage { --w: min(34vh, 18vw); position: absolute; inset: 0; overflow: hidden; }
/* the meadow: the painting (static/meet-friends/meadow.jpg), keeping its grass in view */
.mt-scene {
  position: absolute; inset: 0; background: #9fd7ff url("/static/meet-friends/meadow.jpg") center 72% / cover no-repeat;
}
.mt-tall .mt-scene { background-position: 18% 80%; }
/* Sparkle's rainbow, painted over the sky; its ends fade into the hills */
.mt-rainbow {
  position: absolute; left: 44%; width: 52%; top: 9%; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 1s ease;
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 88%); mask-image: linear-gradient(to bottom, #000 45%, transparent 88%);
  filter: blur(1.4px) saturate(1.25);
}
.mt-tall .mt-rainbow { left: 0; width: 100%; top: 14%; }
.mt-rainbow svg { display: block; width: 100%; height: auto; fill: none; stroke-width: 32; stroke-linecap: butt; }
.mt-rainbow path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.mt-rainbow.on { opacity: .62; }
.mt-rainbow.on path { animation: mtDraw 1.8s cubic-bezier(.3,.6,.3,1) forwards; }
.mt-rainbow.on path:nth-child(2) { animation-delay: .08s; } .mt-rainbow.on path:nth-child(3) { animation-delay: .16s; }
.mt-rainbow.on path:nth-child(4) { animation-delay: .24s; } .mt-rainbow.on path:nth-child(5) { animation-delay: .32s; }
.mt-rainbow.on path:nth-child(6) { animation-delay: .4s; }

/* floating magic glitter */
.mt-glitter { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.mt-glitter i {
  position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--c, #fff);
  box-shadow: 0 0 8px 3px var(--c, #fff); opacity: 0;
  animation: mtFloat 9s linear infinite, mtTwinkle 2.6s ease-in-out infinite;
}

/* the magic veil at the start */
.mt-veil {
  position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #5b3f9e 0%, #2c1f63 45%, #160f3a 100%);
  transition: opacity .9s ease, transform .9s ease;
}
.mt-veil.lift { opacity: 0; transform: scale(1.25); pointer-events: none; }
.mt-veil.gone { display: none; }
.mt-veil-stars i {
  position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px 2px #fff8c4;
  animation: mtTwinkle 1.8s ease-in-out infinite;
}
.mt-veil-title {
  position: relative; text-align: center; color: #fff6c9; font-family: "Fredoka", "Nunito", sans-serif; font-weight: 700;
  font-size: clamp(34px, 6vw, 84px); line-height: 1.05; text-shadow: 0 0 18px rgba(255,214,120,.8), 0 0 42px rgba(255,140,200,.55);
  animation: mtGlow 1.6s ease-in-out infinite alternate, mtPop .9s cubic-bezier(.3,1.5,.5,1);
}
.mt-veil-title small { display: block; font-size: .32em; font-weight: 500; color: #ffd6ea; letter-spacing: .06em; margin-bottom: .3em; }
.mt-wand { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; animation: mtWand 1.3s ease-out forwards; }
.mt-wand svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 6px #fff6c0); }

/* the buttons sit on the picture */
.mt-title {
  position: absolute; left: 14px; top: 12px; z-index: 60; padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.9); font-family: "Fredoka", "Nunito", sans-serif; font-weight: 600; font-size: 17px; color: #c84f86;
  box-shadow: 0 3px 10px rgba(60,90,140,.15);
}
.mt-top { position: absolute; right: 12px; top: 10px; z-index: 90; display: flex; gap: 8px; }
.mt-round {
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer; font-size: 21px; font-weight: 900; color: #2b3550;
  background: rgba(255,255,255,.92); box-shadow: 0 3px 10px rgba(60,90,140,.2);
}
.mt-bottom { position: absolute; left: 14px; bottom: 12px; z-index: 90; display: flex; align-items: center; gap: 12px; }
.mt-pill {
  border: 0; border-radius: 999px; padding: 11px 20px; cursor: pointer; font-family: "Fredoka", "Nunito", sans-serif; font-weight: 600; font-size: 17px;
  color: #2b2450; background: linear-gradient(135deg, #ffe08a, #ffb8d0); box-shadow: 0 3px 10px rgba(60,90,140,.2);
}
.mt-is-busy .mt-pill { background: rgba(255,255,255,.85); font-size: 14px; padding: 9px 16px; }
.mt-hint {
  padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.88); font-family: "Fredoka", "Nunito", sans-serif;
  font-weight: 600; color: #c84f86; animation: mtNudge 1.6s ease-in-out infinite;
}
.mt-hint[hidden] { display: none; }
.mt-round:focus-visible, .mt-pill:focus-visible { outline: 4px solid #ff8aa1; outline-offset: 2px; }

/* the friends */
.mt-friend {             /* its width (its size) and the --pb/--pt/--cx measurements come from meet-friends.js */
  position: absolute; width: 20vw; padding: 0; border: 0; background: none; cursor: pointer;
  transform: translateX(calc(var(--cx, .5) * -100%)) scale(var(--s, 1));
  transform-origin: calc(var(--cx, .5) * 100%) calc(100% - var(--pb, .04) * 100%);
  -webkit-tap-highlight-color: transparent;
}
.mt-friend[hidden] { display: none; }
.mt-friend::before {          /* a soft glow under whoever is talking */
  content: ""; position: absolute; left: 4%; right: 4%; bottom: calc(var(--pb, .04) * 100% - 9%); height: 22%; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255,246,190,.95), rgba(255,246,190,0) 70%);
  opacity: 0; transition: opacity .25s ease; z-index: -2;
}
.mt-friend::after {           /* their shadow on the grass */
  content: ""; position: absolute; left: 22%; right: 22%; bottom: calc(var(--pb, .04) * 100% - 2.5%); height: 6%; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(30,70,20,.42), rgba(30,70,20,0) 70%); z-index: -1;
}
.mt-friend.mt-speaking::before { opacity: 1; }
.mt-friend:focus-visible { outline: 4px solid #ff8aa1; outline-offset: 4px; border-radius: 24px; }
.mt-lift { position: relative; display: block; transform-origin: 50% 100%; transition: transform .25s ease; }
.mt-speaking .mt-lift { transform: scale(1.06); }
.mt-star {                    /* a little star over whoever is talking */
  position: absolute; left: calc(var(--cx, .5) * 100%); top: calc(var(--pt, .03) * 100% - 3%); width: 13%; min-width: 18px;
  transform: translate(-50%, -100%) scale(0); transition: transform .2s ease;
  z-index: 3; filter: drop-shadow(0 0 6px #fff3a0);
}
.mt-star svg { display: block; width: 100%; }
.mt-speaking .mt-star { transform: translate(-50%, -100%) scale(1); animation: mtStarBob 1s ease-in-out infinite; }
.mt-body { display: block; transform-origin: 50% 100%; animation: mtBreathe 3.4s ease-in-out infinite; }
.mt-friend:nth-of-type(2n) .mt-body { animation-delay: -1.2s; }
.mt-friend:nth-of-type(3n) .mt-body { animation-delay: -2.1s; }
.mt-body img { display: block; width: 100%; aspect-ratio: 1122 / 1402; object-fit: contain; pointer-events: none; }
.mt-body img.mt-flip { transform: scaleX(-1); }
.mt-body.mt-walking { animation: mtTrot .32s ease-in-out infinite; }
.mt-body.mt-hop { animation: mtHop .56s cubic-bezier(.3,.7,.4,1); }
.mt-body.mt-wiggle { animation: mtWiggle .5s ease-in-out infinite; }

/* the magic things a friend brings: Biscuit's treasure chest beside him, Puddle's puddle under her */
.mt-prop { position: absolute; pointer-events: none; opacity: 0; transform: scale(.2); transform-origin: 50% 90%; }
.mt-prop svg { display: block; width: 100%; height: auto; overflow: visible; }
.mt-prop.on { animation: mtPropIn .55s cubic-bezier(.3,1.6,.5,1) forwards; }
.mt-prop.on.bye { animation: mtPropOut .5s ease-in forwards; }
.mt-chest { width: calc(var(--w) * .42); filter: drop-shadow(0 6px 6px rgba(30,70,20,.35)); }
.mt-chest-lid { transform-box: fill-box; transform-origin: 8% 100%; transition: transform .6s cubic-bezier(.3,1.5,.5,1); }
.mt-chest.open .mt-chest-lid { transform: rotate(-24deg) translateY(-6px); }
.mt-chest-glow { opacity: 0; transition: opacity .5s ease; }
.mt-chest.open .mt-chest-glow { opacity: 1; animation: mtTwinkle 1.4s ease-in-out infinite; }
.mt-puddle { width: 12vw; transform: translateX(-50%) scale(.2); transform-origin: 50% 50%; }
.mt-puddle.on { animation: mtPuddleIn .6s cubic-bezier(.3,1.5,.5,1) forwards; }
.mt-puddle.on.bye { animation: mtPuddleOut .5s ease-in forwards; }
.mt-ripple { transform-box: fill-box; transform-origin: center; animation: mtRipple 2.4s ease-out infinite; }
.mt-drop { position: absolute; left: 50%; top: 30%; width: 14px; animation: mtDrop .9s ease-out forwards; }

.mt-butterfly { position: absolute; width: 46px; z-index: 50; pointer-events: none; }
.mt-butterfly.a { left: 18%; top: 34%; animation: mtFlutterA 16s ease-in-out infinite; }
.mt-butterfly.b { left: 70%; top: 28%; width: 38px; animation: mtFlutterB 19s ease-in-out infinite; }
.mt-wings { transform-box: fill-box; transform-origin: center; animation: mtFlap .26s ease-in-out infinite alternate; }

/* speech bubble */
.mt-bubble {
  position: absolute; z-index: 55; max-width: min(560px, 80vw); box-sizing: border-box; padding: 12px 24px 15px;
  border-radius: 30px; background: #fff; box-shadow: 0 10px 28px rgba(40,70,120,.22), 0 0 0 6px rgba(255,255,255,.35);
  border: 4px solid #ffe3ea; font-family: "Fredoka", "Nunito", sans-serif;
  font-size: clamp(20px, 2.4vw, 32px); line-height: 1.22; font-weight: 600; text-align: center; color: #2b3550;
}
.mt-bubble[hidden] { display: none; }
.mt-bubble.mt-pop { animation: mtPop .28s cubic-bezier(.3,1.5,.5,1); }
.mt-who { display: block; font-size: .56em; letter-spacing: .08em; text-transform: uppercase; color: #e0608a; margin-bottom: 1px; }
.mt-tail {
  position: absolute; bottom: -16px; width: 26px; height: 26px; transform: translateX(-50%) rotate(45deg);
  background: #fff; border-right: 4px solid #ffe3ea; border-bottom: 4px solid #ffe3ea; border-radius: 0 0 6px 0;
}

/* sparkles, bubbles, balloons, notes and the paper plane */
.mt-fx { position: absolute; inset: 0; pointer-events: none; z-index: 52; }
.mt-fx > span { position: absolute; }
.mt-fx svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mt-bit { width: 26px; height: 26px; margin: -13px 0 0 -13px; animation: mtBurst 1.2s ease-out forwards; }
.mt-spark { width: 20px; height: 20px; margin: -10px 0 0 -10px; filter: drop-shadow(0 0 6px #fff6c0); }
.mt-twinkle { width: var(--sz, 14px); height: var(--sz, 14px); margin: calc(var(--sz, 14px) / -2) 0 0 calc(var(--sz, 14px) / -2);
  animation: mtTwinkleOut 1.1s ease-out forwards; filter: drop-shadow(0 0 4px #fff); }
.mt-fall { top: -40px !important; width: var(--sz, 22px); height: var(--sz, 22px); animation: mtFall 3.4s ease-in forwards; }
.mt-orb {
  width: calc(var(--w) * .6); aspect-ratio: 1; margin: calc(var(--w) * -.3) 0 0 calc(var(--w) * -.3); border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.95) 0 8%, rgba(255,255,255,.25) 22%, rgba(190,230,255,.18) 55%, rgba(255,190,230,.35) 100%);
  box-shadow: inset 0 0 18px rgba(255,255,255,.8), 0 0 22px rgba(255,255,255,.5); padding: calc(var(--w) * .06); box-sizing: border-box;
  animation: mtOrbIn .6s cubic-bezier(.3,1.6,.5,1), mtOrbFloat 3s ease-in-out .6s infinite;
}
.mt-orb-pop { animation: mtOrbPop .35s ease-out forwards !important; }
.mt-balloon { width: calc(var(--w) * .2); margin-left: calc(var(--w) * -.1); animation: mtRise 8s ease-in forwards; }
.mt-note { width: calc(var(--w) * .12); animation: mtNoteUp 3s ease-out forwards; }
.mt-plane { width: calc(var(--w) * .3); offset-path: path("M -60 260 C 300 40, 700 300, 1100 90 S 1700 160, 2600 40"); offset-rotate: auto;
  animation: mtFly 4.4s ease-in-out forwards; filter: drop-shadow(0 4px 4px rgba(60,90,140,.25)); }

@keyframes mtBreathe { 0%,100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(-.8%) scaleY(1.012); } }
@keyframes mtTrot { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-3%) rotate(1deg); } }
@keyframes mtHop {
  0% { transform: translateY(0) scale(1, 1); }
  14% { transform: translateY(0) scale(1.06, .9); }
  48% { transform: translateY(-26%) scale(.96, 1.06); }
  82% { transform: translateY(0) scale(1.05, .93); }
  100% { transform: translateY(0) scale(1, 1); }
}
@keyframes mtWiggle { 0%,100% { transform: rotate(-2.4deg); } 50% { transform: rotate(2.6deg); } }
@keyframes mtPop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes mtPropIn { from { opacity: 0; transform: scale(.2) translateY(-40%); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes mtPropOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.4) translateY(20%); } }
@keyframes mtPuddleIn { from { opacity: 0; transform: translateX(-50%) scale(.2); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes mtPuddleOut { from { opacity: 1; transform: translateX(-50%) scale(1); } to { opacity: 0; transform: translateX(-50%) scale(.3); } }
@keyframes mtRipple { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.7); opacity: 0; } }
@keyframes mtDrop { 0% { transform: translate(0,0) scale(.6); opacity: 1; } 60% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 0; } }
@keyframes mtBurst { 0% { transform: translate(0,0) scale(.3) rotate(0); opacity: 0; } 15% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--r)); opacity: 0; } }
@keyframes mtFall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(110vh) rotate(var(--r)); opacity: 0; } }
@keyframes mtDraw { to { stroke-dashoffset: 0; } }
@keyframes mtNudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes mtFlap { from { transform: scaleX(1); } to { transform: scaleX(.35); } }
@keyframes mtFlutterA { 0%,100% { transform: translate(0,0); } 25% { transform: translate(14vw,-6vh); } 50% { transform: translate(26vw,4vh); } 75% { transform: translate(10vw,10vh); } }
@keyframes mtFlutterB { 0%,100% { transform: translate(0,0); } 30% { transform: translate(-16vw,6vh); } 60% { transform: translate(-6vw,-8vh); } 80% { transform: translate(8vw,2vh); } }
@keyframes mtFloat { from { transform: translate(0, 0); } to { transform: translate(30px, -120px); } }
@keyframes mtTwinkle { 0%,100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes mtTwinkleOut { 0% { opacity: 0; transform: scale(.3) rotate(0); } 30% { opacity: 1; transform: scale(1.1) rotate(40deg); }
  100% { opacity: 0; transform: translateY(-30px) scale(.4) rotate(120deg); } }
@keyframes mtGlow { from { filter: brightness(1); } to { filter: brightness(1.25); } }
@keyframes mtWand { 0% { opacity: 0; transform: scale(.2) rotate(0); } 25% { opacity: 1; transform: scale(1.3) rotate(60deg); }
  100% { opacity: 0; transform: translateY(40px) scale(.3) rotate(200deg); } }
@keyframes mtStarBob { 0%,100% { transform: translate(-50%, -100%) scale(1) rotate(-8deg); } 50% { transform: translate(-50%, -125%) scale(1.12) rotate(8deg); } }
@keyframes mtOrbIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes mtOrbFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes mtOrbPop { to { transform: scale(1.5); opacity: 0; } }
@keyframes mtRise { 0% { transform: translate(0, 30px) scale(.4); opacity: 0; } 10% { transform: translate(0, 0) scale(1); opacity: 1; }
  45% { transform: translate(var(--sway, 0), -22vh) rotate(4deg); } 100% { transform: translate(calc(var(--sway, 0) * -1), -80vh) rotate(-4deg); opacity: 1; } }
@keyframes mtNoteUp { 0% { transform: translate(0, 0) scale(.3); opacity: 0; } 15% { opacity: 1; transform: translate(0, -10px) scale(1); }
  100% { transform: translate(var(--sway, 0), -26vh) rotate(12deg); opacity: 0; } }
@keyframes mtFly { from { offset-distance: 0%; } to { offset-distance: 100%; } }

@media (max-width: 620px) {
  .mt-title { font-size: 14px; }
  .mt-round { width: 42px; height: 42px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .mt-rainbow.on path { animation: none; stroke-dashoffset: 0; }
  .mt-body, .mt-body.mt-wiggle, .mt-body.mt-walking, .meet-card:hover img, .mt-bubble.mt-pop, .mt-hint,
  .mt-butterfly, .mt-wings, .mt-ripple, .mt-glitter i, .mt-veil-title, .mt-speaking .mt-star, .mt-orb { animation: none; }
  .mt-glitter i { opacity: .6; }
  .mt-body.mt-hop { animation: mtHop .3s ease-out; }
  .mt-prop.on, .mt-puddle.on { animation: none; opacity: 1; transform: none; }
  .mt-puddle.on { transform: translateX(-50%); }
}
