/* ==========================================================================
   rooms.css (v14) — castle top bar 2.0, premium hub plaques, outfits,
   SYPIALNIA · GARDEROBA · POKÓJ ZABAW (+ mini-games). Loaded after castle.css.
   Palette: cream #FFF9EC · parchment #F3E2BF · gold #C99A3C/#E9C46A · plum #4A1F5C/#6B2E8A
   ========================================================================== */

/* —— Castle top bar: castle home · name + 4 meters · coin purse · padlock —— */
.topbar--castle { grid-template-columns: auto minmax(0, 1fr) auto; }
.tb-home-castle {
  appearance: none; border: 0; background: none; padding: 0 .1rem;
  width: 48px; height: 48px; display: grid; place-items: center;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform .14s ease;
}
.tb-home-castle img {
  height: 42px; width: auto; display: block; pointer-events: none; user-select: none;
  filter: drop-shadow(0 2px 0 rgba(142, 100, 32, .55)) drop-shadow(0 4px 5px rgba(74, 31, 92, .22));
}
.tb-home-castle:active { transform: translateY(2px) scale(.94); }
.topbar--castle .tb-right { gap: .5rem; }

.tb-purse {
  appearance: none; border: 0; background: none; padding: 0 0 0 4px; margin: 0;
  position: relative; display: inline-flex; align-items: center; height: 44px;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  font-family: var(--font);
  transition: transform .14s ease;
}
.tb-purse:active { transform: translateY(2px) scale(.96); }
.tb-purse-coin {
  width: 34px; height: 34px; object-fit: contain; display: block;
  position: relative; z-index: 2; pointer-events: none;
  filter: drop-shadow(0 2px 0 rgba(142, 100, 32, .6)) drop-shadow(0 3px 4px rgba(74,31,92,.2));
}
.tb-purse-n {
  position: relative; z-index: 1;
  margin-left: -14px; padding: .14rem .62rem .16rem 1.15rem;
  min-width: 2.6rem; text-align: center;
  font-size: 1.08rem; font-weight: 800; line-height: 1.1; color: #4A1F5C;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #FFFDF4 0%, #F7E3A8 100%);
  box-shadow: inset 0 0 0 1.5px #C99A3C, inset 0 2px 0 1.5px rgba(255,255,255,.7), 0 2px 0 #A8741E;
}
.tb-purse.is-bump .tb-purse-coin { animation: purseCoin .55s cubic-bezier(.3,1.6,.5,1); }
.tb-purse.is-bump .tb-purse-n { animation: purseN .45s ease; }
@keyframes purseCoin { 0% { transform: scale(1); } 40% { transform: scale(1.32) rotate(-12deg); } 100% { transform: scale(1); } }
@keyframes purseN { 0%,100% { color: #4A1F5C; } 40% { color: #B8306A; transform: translateY(-1px); } }
.coin-fly {
  position: fixed; z-index: 9999; width: 30px; height: 30px; object-fit: contain;
  transform: translate(-50%, -50%) scale(1.15); pointer-events: none;
  filter: drop-shadow(0 3px 3px rgba(74,31,92,.35));
  transition: left .6s cubic-bezier(.55,-.25,.6,1), top .6s cubic-bezier(.3,0,.8,.6), transform .6s ease, opacity .2s ease .5s;
}
.coin-fly.is-go { transform: translate(-50%, -50%) scale(.75) rotate(200deg); opacity: .2; }

.tb-lock {
  appearance: none; border: 0; background: none; padding: 0;
  width: 44px; height: 46px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent; font-family: var(--font);
  opacity: .82;
}
.tb-lock-ico { position: relative; width: 28px; height: 28px; display: grid; place-items: center; }
.tb-lock-ico img { height: 24px; width: auto; display: block; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(60,25,70,.3)); }
.tb-lock-lab { font-size: .58rem; font-weight: 800; color: #7A5A74; letter-spacing: .05em; line-height: 1; }
.tb-lock .hold-ring {
  position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px);
  transform: rotate(-90deg); pointer-events: none; overflow: visible;
}
.tb-lock .hold-ring circle { stroke: #F6CB52; stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; filter: drop-shadow(0 0 2px #C99A3C); }
.tb-lock.holding { opacity: 1; }
.tb-lock.holding .hold-ring circle { opacity: 1; animation: tbHold 3s linear forwards; }
.tb-lock.holding .tb-lock-ico img { animation: lockShake 3s linear forwards; }
@keyframes lockShake { 0%,100% { transform: none; } 10%,30%,50%,70%,90% { transform: rotate(-6deg); } 20%,40%,60%,80% { transform: rotate(6deg); } }
.tb-lock.nudge { animation: tbNudge .45s ease; }
.topbar--castle .tb-parent-spacer { width: 44px; height: 44px; }

@media (orientation: landscape) and (max-height: 500px) {
  .tb-home-castle { width: 44px; height: 42px; }
  .tb-home-castle img { height: 38px; }
  .tb-purse { height: 40px; }
  .tb-lock { height: 42px; }
}
@media (max-width: 520px) {
  .topbar--castle .tb-right { gap: .3rem; }
  .tb-home-castle { width: 40px; }
  .tb-home-castle img { height: 38px; }
  .tb-purse-coin { width: 30px; height: 30px; }
  .tb-purse-n { font-size: .98rem; min-width: 2.2rem; padding-right: .5rem; }
  .tb-lock { width: 38px; }
  .topbar--castle.topbar--care .tb-meters { gap: .28rem; }
  .topbar--castle .tb-meter { gap: .12rem; }
  .topbar--castle .tb-meter-ico { width: 17px; height: 17px; }
  .topbar--castle .tb-meter-track { width: clamp(16px, 5vw, 30px); height: 8px; }
}

/* ==========================================================================
   Castle hub — arched gilded plaques + royal "Baw się" hero
   ========================================================================== */
body.world-zamek .hub-btn.cplq {
  position: relative; isolation: isolate;
  width: 100%; max-width: 134px; min-height: 0;
  padding: .5rem .35rem .5rem;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .25rem;
  border: 3px solid transparent;
  border-radius: 50% 50% 18px 18px / 46px 46px 18px 18px;
  background:
    linear-gradient(180deg, var(--pa, #FFFBF1) 0%, var(--pb, #F1DDB5) 100%) padding-box,
    linear-gradient(180deg, #FFEFB8 0%, #E0B04A 45%, #9C6C1E 100%) border-box;
  box-shadow: 0 5px 0 #6E4A16, 0 11px 18px rgba(74, 31, 92, .28);
  color: #4A1F5C; text-shadow: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
body.world-zamek .hub-btn.cplq::before {
  content: ""; position: absolute; inset: 4px; z-index: -1; pointer-events: none;
  border-radius: 50% 50% 14px 14px / 42px 42px 14px 14px;
  border: 1.5px solid rgba(201, 154, 60, .55);
  background: radial-gradient(ellipse 70% 50% at 50% 38%, var(--glow, rgba(255,255,255,.75)), transparent 72%);
}
body.world-zamek .hub-btn.cplq::after {
  /* gold keystone stud on top of the arch */
  content: ""; position: absolute; left: 50%; top: -7px; width: 13px; height: 13px; margin-left: -6.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFF6C8 0 22%, #F2C24E 45%, #A8741E 100%);
  box-shadow: 0 1px 0 #6E4A16;
}
body.world-zamek .hub-btn.cplq:active { transform: translateY(4px); box-shadow: 0 1px 0 #6E4A16, 0 5px 10px rgba(74,31,92,.22); }
.cplq-win { width: 84px; height: 76px; display: block; position: relative; flex: 0 0 auto; }
.cplq-win img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; display: block; pointer-events: none; user-select: none;
  filter: drop-shadow(0 3px 2px rgba(90, 50, 20, .35));
  transition: transform .25s cubic-bezier(.3,1.6,.5,1);
}
body.world-zamek .hub-btn.cplq:hover .cplq-win img { transform: translateY(-3px) scale(1.05); }
.cplq-lab {
  display: block; white-space: nowrap;
  font-size: .98rem; font-weight: 800; line-height: 1.1; letter-spacing: .01em;
  color: #FFF3D6; text-shadow: 0 1px 0 rgba(40,10,50,.55);
  padding: .12rem .7rem .16rem; border-radius: 9px;
  background: linear-gradient(180deg, #8E4FC0 0%, #5A2370 100%);
  box-shadow: inset 0 0 0 1.5px #E9C46A, inset 0 2px 0 1.5px rgba(255,255,255,.22), 0 2px 0 #3A1248;
}
body.world-zamek .cplq--rose  { --pa: #FFF6F2; --pb: #F3D1CB; --glow: rgba(255, 210, 220, .9); }
body.world-zamek .cplq--sky   { --pa: #F6FBFF; --pb: #CFE2F0; --glow: rgba(210, 236, 255, .95); }
body.world-zamek .cplq--gold  { --pa: #FFFBEA; --pb: #F1D68A; --glow: rgba(255, 244, 200, .95); }
body.world-zamek .cplq--night { --pa: #5B4C9A; --pb: #2D2463; --glow: rgba(160, 150, 255, .5); }
body.world-zamek .cplq--night::before {
  background:
    radial-gradient(circle at 22% 24%, #FFE7A0 0 1.3px, transparent 2px),
    radial-gradient(circle at 78% 18%, #fff 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 84% 52%, #FFE7A0 0 1px, transparent 1.7px),
    radial-gradient(circle at 15% 58%, #fff 0 .9px, transparent 1.6px),
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(160,150,255,.45), transparent 72%);
}

/* hero: royal velvet "Baw się" — the one button that clearly says PLAY */
body.world-zamek .hub-btn.cplay {
  position: relative; isolation: isolate; overflow: visible;
  width: min(100%, 290px); max-width: none; min-height: 0;
  flex-direction: row; justify-content: flex-start; gap: .55rem;
  padding: .45rem 1.05rem .5rem .55rem;
  border: 3px solid transparent; border-radius: 24px;
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(255,255,255,.22), transparent 55%) padding-box,
    linear-gradient(180deg, #A766DA 0%, #6E2E92 52%, #4A1866 100%) padding-box,
    linear-gradient(180deg, #FFF2BE 0%, #E9B94C 40%, #A8741E 100%) border-box;
  box-shadow: 0 6px 0 #2E0E3C, 0 14px 24px rgba(58, 18, 72, .42), inset 0 0 0 1.5px rgba(255, 231, 160, .35);
  color: #FFF3D6; text-shadow: none;
  animation: cplayBreath 2.8s ease-in-out infinite;
  margin-top: .35rem;
}
body.world-zamek .hub-btn.cplay:active { transform: translateY(5px); box-shadow: 0 1px 0 #2E0E3C, 0 6px 12px rgba(58,18,72,.32); animation: none; }
@keyframes cplayBreath { 0%,100% { transform: scale(1); } 50% { transform: scale(1.035); } }
.cplay-art { width: 74px; height: 64px; flex: 0 0 auto; position: relative; margin: -22px 0 -4px; }
.cplay-art img {
  width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none;
  filter: drop-shadow(0 4px 3px rgba(30, 8, 40, .45));
  animation: cplayToy 2.8s ease-in-out infinite;
}
@keyframes cplayToy { 0%,100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-4px); } }
.cplay-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; min-width: 0; }
.cplay-lab {
  font-size: 1.62rem; font-weight: 800; letter-spacing: .01em; white-space: nowrap;
  color: #FFE7A0;
  text-shadow: 0 2px 0 #3A1248, 0 0 10px rgba(255, 210, 110, .35);
}
.cplay-sub { font-size: .8rem; font-weight: 700; color: #E9D5FF; margin-top: .14rem; white-space: nowrap; }
.cplay-glint { position: absolute; inset: 0; border-radius: 21px; overflow: hidden; pointer-events: none; z-index: 1; }
.cplay-glint::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 34%; left: -50%;
  background: linear-gradient(100deg, transparent, rgba(255, 250, 225, .5), transparent);
  transform: skewX(-18deg);
  animation: cplayGlint 4.2s ease-in-out 1.2s infinite;
}
@keyframes cplayGlint { 0%, 62% { left: -50%; } 100% { left: 130%; } }
.cplay::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7 3.5l7.5 6.5L7 16.5z' fill='%23FFE7A0' stroke='%233A1248' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
body.world-zamek .hub-btn.cplay { padding-right: 2.1rem; }

body.world-zamek .hub-col-l, body.world-zamek .hub-col-r { justify-content: space-around; }

@media (orientation: landscape) and (max-height: 500px) {
  body.world-zamek .hub-btn.cplq { max-width: 124px; padding: .38rem .3rem .42rem; }
  .cplq-win { width: 78px; height: 66px; }
  .cplq-lab { font-size: .9rem; padding: .1rem .6rem .14rem; }
  body.world-zamek .hub-btn.cplay { width: min(100%, 270px); padding-top: .34rem; padding-bottom: .38rem; margin-top: .2rem; }
  .cplay-art { width: 64px; height: 54px; margin-top: -18px; }
  .cplay-lab { font-size: 1.42rem; }
  .cplay-sub { font-size: .72rem; }
  body.world-zamek .hub-pet-img { height: min(46vh, 150px); }
}
@media (orientation: portrait) {
  body.world-zamek .hub-btn.cplq { max-width: 118px; }
  .cplq-win { width: 84px; height: 76px; }
  body.world-zamek .hub-btn.cplay { width: min(100%, 300px); }
}
@media (max-width: 400px) {
  body.world-zamek .hub-stage { grid-template-columns: minmax(96px, .85fr) minmax(150px, 1.4fr) minmax(96px, .85fr); gap: .4rem .3rem; }
  .cplq-lab { font-size: .9rem; padding: .1rem .5rem .14rem; }
  body.world-zamek .hub-col-c { position: relative; }
}

/* ==========================================================================
   Outfits — painted overlays on the living sprite
   ========================================================================== */
.pet-rig { overflow: visible; }
.pet-wear {
  position: absolute; z-index: 4; pointer-events: none; user-select: none;
  max-width: none; height: auto; transform-origin: 50% 50%;
  filter: drop-shadow(0 2px 1.5px rgba(60, 25, 70, .28));
}
.pet-wear--back { z-index: 0; }
.pet-wear--okulary { z-index: 5; }
.wd-pet .pet-wear { animation: wearIn .35s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes wearIn { from { opacity: 0; transform: translateY(-14%) scale(.8); } }

/* ==========================================================================
   Shared room shells
   ========================================================================== */
body.room-bedroom .sky, body.room-wardrobe .sky, body.room-playroom .sky {
  background-size: cover !important; background-position: center !important; filter: none;
}
body.room-bedroom .sky  { background-image: url('art/tlo-sypialnia.jpg') !important; }
body.room-wardrobe .sky { background-image: url('art/tlo-garderoba.jpg') !important; }
body.room-playroom .sky { background-image: url('art/tlo-pokoj-zabaw.jpg') !important; }
body.room-bedroom .sky::after, body.room-wardrobe .sky::after, body.room-playroom .sky::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,244,230,.06), rgba(80,40,70,.14));
}
body:has(.bedroom-screen) #app, body:has(.wardrobe-screen) #app, body:has(.playroom-screen) #app { max-width: 760px; height: 100dvh; }
@media (orientation: landscape) {
  body:has(.bedroom-screen) #app, body:has(.wardrobe-screen) #app, body:has(.playroom-screen) #app { max-width: 1040px; }
}
.bedroom-screen, .wardrobe-screen, .playroom-screen {
  position: relative; min-height: 0; overflow: hidden;
  padding: .2rem .6rem .5rem; gap: .3rem;
}
.room-hint-top { display: none; }

/* parchment speech bubble (Smoczek talks) */
.pr-bubble {
  position: relative; z-index: 3;
  background: linear-gradient(180deg, #FFFDF6 0%, #F7EAD0 100%);
  border: 2.5px solid #C99A3C; border-radius: 18px;
  box-shadow: 0 3px 0 #8E6420, 0 10px 18px rgba(74,31,92,.2);
  padding: .45rem .8rem .55rem;
  color: #4A1F5C; font-weight: 700; font-size: .98rem; line-height: 1.25;
  text-align: center;
}
.pr-bubble b { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #A8741E; margin-bottom: .1rem; }
.pr-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -10px; width: 16px; height: 16px; margin-left: -8px;
  background: #F7EAD0; border-right: 2.5px solid #C99A3C; border-bottom: 2.5px solid #C99A3C;
  transform: rotate(45deg);
}
.wd-btn, .pr-go, .pr-bubble-btn {
  appearance: none; cursor: pointer; font-family: var(--font); touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  font-size: 1.02rem; font-weight: 800; line-height: 1.1; white-space: nowrap;
  padding: .45rem 1.1rem .5rem; border-radius: 15px;
  color: #FFF3D6; text-shadow: 0 1px 0 rgba(40,10,50,.5);
  border: 2.5px solid #E9C46A;
  background: linear-gradient(180deg, #A465D6 0%, #6B2E8A 58%, #521E6C 100%);
  box-shadow: 0 4px 0 #3A1248, 0 8px 14px rgba(58,18,72,.28), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform .12s ease, box-shadow .12s ease;
}
.wd-btn:active, .pr-go:active, .pr-bubble-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #3A1248; }
.wd-btn--soft { background: linear-gradient(180deg, #FFFBF1, #F1DDB8); color: #4A1F5C; text-shadow: none; border-color: #C99A3C; box-shadow: 0 4px 0 #8E6420, 0 8px 14px rgba(74,31,92,.16); }
.wd-btn--buy { background: linear-gradient(180deg, #FFF2BE 0%, #F2C24E 55%, #D29A2C 100%); color: #4A1F5C; text-shadow: 0 1px 0 rgba(255,255,255,.6); border-color: #A8741E; box-shadow: 0 4px 0 #8E6420, 0 8px 14px rgba(120,70,20,.25); }
.wd-btn--earn { background: linear-gradient(180deg, #FFF5F3, #F3D1CB); color: #7A2D4E; text-shadow: none; border-color: #D99AA8; box-shadow: 0 4px 0 #B76A80; font-size: .92rem; }
.ci { height: 1.25em; width: auto; vertical-align: -.28em; display: inline-block; filter: drop-shadow(0 1px 0 rgba(142,100,32,.5)); }

/* ==========================================================================
   SYPIALNIA — candle, canopy bed, sleepy Smoczek
   ========================================================================== */
.bed-night {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
  background:
    radial-gradient(60% 50% at 18% 30%, rgba(120, 130, 255, .12), transparent 70%),
    linear-gradient(180deg, rgba(16, 10, 52, .72), rgba(28, 12, 58, .66));
  transition: opacity 1s ease;
}
.bedroom-screen.is-asleep .bed-night { opacity: 1; pointer-events: auto; }
.bedroom-stage {
  position: relative; z-index: 2; flex: 1 1 auto; min-height: 0; width: 100%;
  display: grid; align-items: end; gap: .3rem .4rem;
  grid-template-columns: minmax(78px, .55fr) minmax(130px, 1fr) minmax(190px, 1.45fr) auto;
  grid-template-areas: "candle pet bed back";
  padding: 0 .1rem .2rem;
}
.bed-candle {
  grid-area: candle; justify-self: center; align-self: end;
  appearance: none; border: 0; background: none; padding: 1.4rem .5rem 0; margin: 0 0 .4rem;
  position: relative; cursor: pointer; line-height: 0;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.bed-candle img {
  position: relative; z-index: 2; display: block; height: min(36vh, 150px); width: auto;
  filter: drop-shadow(0 6px 6px rgba(60, 25, 70, .35));
  transition: filter .8s ease;
}
.bed-candle:active img { transform: scale(.97); }
/* flame sits on the wick (wick ≈ 42% across the candle art) */
.bed-flame {
  position: absolute; z-index: 3; left: calc(.5rem + min(36vh, 150px) * .2235); top: 1.4rem;
  width: calc(min(36vh, 150px) * .11); height: calc(min(36vh, 150px) * .2);
  transform: translate(-50%, -86%); transform-origin: 50% 100%;
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse 55% 60% at 50% 72%, #fff 0 22%, #FFF2A8 38%, #FFC24A 62%, #FF7A2A 86%, rgba(255,90,30,0) 100%);
  box-shadow: 0 0 12px 4px rgba(255, 196, 90, .55);
  animation: flameFlicker .9s ease-in-out infinite alternate;
  transition: opacity .25s ease, transform .3s ease;
}
.bed-flame span { position: absolute; left: 30%; right: 30%; bottom: 8%; height: 30%; border-radius: 50%; background: rgba(120, 170, 255, .55); }
@keyframes flameFlicker {
  0% { transform: translate(-50%, -86%) scale(1, 1) rotate(-2deg); }
  50% { transform: translate(-50%, -86%) scale(.92, 1.08) rotate(2deg); }
  100% { transform: translate(-50%, -86%) scale(1.04, .95) rotate(-1deg); }
}
.bed-candle-glow {
  position: absolute; z-index: 1; left: calc(.5rem + min(36vh, 150px) * .2235); top: 1.4rem;
  width: 210px; height: 210px; margin: -105px 0 0 -105px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 216, 120, .5) 0%, rgba(255, 196, 90, .18) 40%, transparent 70%);
  animation: glowPulse2 2.4s ease-in-out infinite;
  transition: opacity .6s ease;
}
@keyframes glowPulse2 { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: 1; } }
.bed-smoke {
  position: absolute; z-index: 3; left: calc(.5rem + min(36vh, 150px) * .2235); top: 1.4rem;
  width: 10px; height: 34px; margin-left: -5px; margin-top: -34px; border-radius: 50%;
  background: linear-gradient(0deg, rgba(220,215,235,.9), rgba(220,215,235,0));
  filter: blur(2px); opacity: 0; pointer-events: none;
}
.is-asleep .bed-flame { opacity: 0; transform: translate(-50%, -86%) scale(.2); animation: none; }
.is-asleep .bed-candle-glow { opacity: 0; }
.is-asleep .bed-smoke { animation: smokeUp 1.8s ease-out; }
.is-asleep .bed-candle img { filter: brightness(.62) saturate(.8) drop-shadow(0 6px 6px rgba(10,5,30,.4)); }
@keyframes smokeUp { 0% { opacity: .9; transform: translateY(0) scaleX(1); } 100% { opacity: 0; transform: translateY(-46px) scaleX(2.4) rotate(12deg); } }
.bedroom-screen:not(.is-asleep) .bed-candle::after {
  /* gentle "tap me" sparkle ring */
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 70%; height: 10px; margin-left: -35%;
  border-radius: 50%; background: radial-gradient(ellipse, rgba(255, 226, 122, .7), transparent 70%);
  animation: glowPulse2 2.4s ease-in-out infinite;
}

.bedroom-pet-zone {
  grid-area: pet; justify-self: center; align-self: end;
  display: flex; flex-direction: column; align-items: center; position: relative;
  transition: opacity .55s ease, transform .55s ease;
  margin-bottom: .3rem;
}
.bedroom-pet { height: min(44vh, 190px); }
.is-asleep .bedroom-pet-zone { opacity: 0; transform: translateX(30%) scale(.85); pointer-events: none; }
.pet-sprite.is-sleepy .pet-lid { animation: none; transform: scaleY(.52); transition: transform .4s ease; }
.pet-sprite.is-sleepy .pet-rig { animation: petBreathe 4.6s ease-in-out infinite, sleepySway 6s ease-in-out infinite; }
@keyframes sleepySway { 0%,100% { rotate: 0deg; } 50% { rotate: -2.5deg; } }

.bed-wrap { grid-area: bed; justify-self: center; align-self: end; position: relative; line-height: 0; margin-bottom: .1rem; }
.bed-img {
  display: block; height: min(70vh, 300px); width: auto; max-width: 100%;
  filter: drop-shadow(0 10px 10px rgba(60, 25, 70, .3));
  transition: filter .9s ease;
}
.is-asleep .bed-img { filter: brightness(.78) saturate(.9) drop-shadow(0 10px 10px rgba(10,5,30,.4)); }
.bed-sleeper {
  position: absolute; left: 24%; top: 38%; width: 48%; height: auto; z-index: 2;
  opacity: 0; transform: translateY(-14%) scale(.9); pointer-events: none;
  transition: opacity .6s ease .35s, transform .6s cubic-bezier(.3,1.4,.5,1) .35s;
  filter: drop-shadow(0 0 10px rgba(200, 210, 255, .45)) drop-shadow(0 4px 4px rgba(20,10,50,.3));
}
.is-asleep .bed-sleeper { opacity: 1; transform: none; animation: sleeperBreathe 3.6s ease-in-out 1s infinite; }
@keyframes sleeperBreathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.025, 1.04); } }
.is-asleep .bed-wrap { cursor: pointer; }
.bed-zzz { position: absolute; left: 28%; top: 36%; width: 30%; height: 10%; z-index: 4; pointer-events: none; }
.bed-z {
  position: absolute; bottom: 0;
  font-size: calc(2.1rem * var(--s, 1)); font-weight: 800; line-height: 1;
  color: #FFF3D6; -webkit-text-stroke: 3px #5A2370; paint-order: stroke fill;
  text-shadow: 0 0 8px rgba(200, 210, 255, .7);
  animation: bedZ 2.6s ease-out forwards;
}
@keyframes bedZ {
  0% { opacity: 0; transform: translate(0, 0) scale(.5) rotate(-10deg); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(34px, -80px) scale(1.2) rotate(12deg); }
}
.bedroom-back { grid-area: back; }
body.world-zamek .bedroom-hint {
  position: relative; z-index: 2; align-self: center; margin: 0 auto .1rem;
  padding: .28rem .9rem; font-size: .95rem; text-align: center;
}
@media (orientation: landscape) {
  body.world-zamek .bedroom-screen .bedroom-hint {
    display: block !important; position: absolute; top: .2rem; left: 50%; transform: translateX(-50%);
    white-space: nowrap; font-size: .85rem; padding: .2rem .8rem;
  }
}
@media (orientation: portrait) {
  .bedroom-stage {
    grid-template-columns: minmax(84px, .8fr) minmax(130px, 1.3fr) auto;
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "bed bed bed" "candle pet back";
    align-items: end;
  }
  .bed-img { height: auto; width: min(92vw, 400px); max-height: 44vh; object-fit: contain; }
  .bedroom-pet { height: min(24vh, 180px); }
  .bed-candle img { height: min(20vh, 150px); }
  .bed-flame, .bed-candle-glow, .bed-smoke { left: calc(.5rem + min(20vh, 150px) * .2235); }
  .bed-flame { width: calc(min(20vh, 150px) * .11); height: calc(min(20vh, 150px) * .2); }
}

/* ==========================================================================
   GARDEROBA — try-on wardrobe
   ========================================================================== */
.wardrobe-stage {
  position: relative; flex: 1 1 auto; min-height: 0; width: 100%;
  display: grid; gap: .4rem .6rem; align-items: end;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 290px) minmax(0, 1fr);
  grid-template-areas: "panel pet back";
  padding: .2rem .1rem .2rem;
}
.wd-pet-zone { grid-area: pet; justify-self: center; align-self: end; display: flex; flex-direction: column; align-items: center; margin-bottom: 4%; }
.wd-pet { line-height: 0; min-height: 40px; }
.wardrobe-pet { height: min(56vh, 230px); }
.wardrobe-back { grid-area: back; justify-self: end; }
.wd-panel {
  grid-area: panel; align-self: center; justify-self: stretch; position: relative;
  max-width: 400px; width: 100%; margin: 0 auto;
  background: linear-gradient(180deg, rgba(255,252,243,.97) 0%, rgba(243,226,191,.97) 100%);
  border: 3px solid #C99A3C; border-radius: 22px;
  box-shadow: inset 0 0 0 2px #FFF6DE, 0 5px 0 #8E6420, 0 16px 28px rgba(58,18,72,.28);
  padding: 1.15rem .6rem .6rem;
}
.wd-title {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -55%); white-space: nowrap;
}
.wd-title span {
  display: block; font-size: 1.05rem; font-weight: 800; color: #FFF3D6; letter-spacing: .03em;
  text-shadow: 0 1px 0 rgba(40,10,50,.55);
  padding: .16rem 1.1rem .2rem; border-radius: 10px;
  background: linear-gradient(180deg, #8E4FC0, #5A2370);
  box-shadow: inset 0 0 0 1.5px #E9C46A, 0 3px 0 #3A1248, 0 6px 10px rgba(58,18,72,.25);
}
.wd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.wd-grid.is-hi { animation: wdHi .9s ease; }
@keyframes wdHi { 30% { transform: scale(1.03); } }
.wd-item {
  appearance: none; cursor: pointer; font-family: var(--font); position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: .3rem .2rem .3rem; min-height: 0; aspect-ratio: 1 / 1.02;
  border: 2px solid #D8B66A; border-radius: 16px;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, #FFFFFF 0%, #FFF6E2 60%, #F4E3BE 100%);
  box-shadow: 0 3px 0 #B98A3E, 0 6px 10px rgba(74,31,92,.12);
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.wd-item:active { transform: translateY(2px); box-shadow: 0 1px 0 #B98A3E; }
.wd-item-art { flex: 1 1 auto; width: 100%; min-height: 0; position: relative; margin-bottom: .2rem; }
.wd-item-art img { position: absolute; inset: -4% 2% 0; width: 96%; height: 104%; max-width: none; object-fit: contain; display: block; pointer-events: none; filter: drop-shadow(0 3px 2px rgba(60,25,70,.25)); }
.wd-item.is-sel { border-color: #F2C24E; box-shadow: 0 0 0 3px rgba(242, 194, 78, .55), 0 3px 0 #B98A3E, 0 8px 16px rgba(201,154,60,.4); transform: translateY(-2px); }
.wd-item.is-sel .wd-item-art img { animation: fruitBob 1.2s ease-in-out infinite; }
.wd-item.is-worn { background: radial-gradient(ellipse 80% 60% at 50% 40%, #FFFFFF 0%, #F6EEFF 60%, #E5D5F3 100%); border-color: #A465D6; }
.wd-tag {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: .15rem;
  font-size: .8rem; font-weight: 800; line-height: 1; white-space: nowrap;
  padding: .12rem .45rem .14rem .2rem; border-radius: 999px;
}
.wd-tag b { font-weight: 800; }
.wd-tag--price { color: #4A1F5C; background: linear-gradient(180deg, #FFF4D2, #F7DC92); box-shadow: inset 0 0 0 1.5px #C99A3C; }
.wd-tag--price .ci { height: 1.35em; }
.wd-item.is-poor .wd-tag--price { color: #8A7A86; background: linear-gradient(180deg, #F5EFE6, #E6DCCB); box-shadow: inset 0 0 0 1.5px #CDBB9A; }
.wd-item.is-poor .wd-tag--price .ci { filter: grayscale(.6) opacity(.75); }
.wd-tag--own { color: #2E6A1E; background: #E3F5D3; box-shadow: inset 0 0 0 1.5px #8CC66A; padding-left: .45rem; }
.wd-tag--on { color: #FFF3D6; background: linear-gradient(180deg, #8E4FC0, #5A2370); box-shadow: inset 0 0 0 1.5px #E9C46A; padding-left: .45rem; }
.wd-check {
  position: absolute; right: -6px; top: -6px; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(180deg, #9BDA6A, #4E9A2A); border: 2px solid #fff;
  box-shadow: 0 2px 0 #2E6A1E, 0 3px 6px rgba(0,0,0,.2); display: grid; place-items: center;
}
.wd-check svg { width: 15px; height: 15px; }
.wd-action { display: flex; align-items: center; justify-content: center; gap: .55rem; min-height: 46px; margin-top: .5rem; flex-wrap: wrap; }
.wd-name { font-weight: 800; color: #4A1F5C; font-size: .98rem; }
.wd-note { margin: 0; font-weight: 700; color: #7A5A44; font-size: .9rem; text-align: center; }

@media (orientation: landscape) and (max-height: 500px) {
  .wd-panel { padding: 1rem .5rem .45rem; max-width: 370px; }
  .wd-grid { gap: .4rem; }
  .wd-item { aspect-ratio: 1 / .96; border-radius: 13px; padding: .2rem .15rem .22rem; }
  .wd-tag { font-size: .72rem; }
  .wd-action { min-height: 40px; margin-top: .35rem; gap: .4rem; }
  .wd-btn { font-size: .92rem; padding: .34rem .85rem .4rem; }
  .wd-name { font-size: .86rem; }
  .wardrobe-pet { height: min(54vh, 200px); }
}
@media (orientation: portrait) {
  .wardrobe-stage {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "pet back" "panel panel";
    align-items: end;
  }
  .wd-pet-zone { margin-bottom: 0; justify-self: center; padding-left: 72px; }
  .wardrobe-back { align-self: end; }
  .wardrobe-pet { height: min(26vh, 220px); }
  .wd-panel { max-width: 460px; margin-top: 1.4rem; }
  .wd-pet-zone { margin-bottom: .2rem; }
}

/* ==========================================================================
   POKÓJ ZABAW — menu
   ========================================================================== */
.pr-stage { position: relative; flex: 1 1 auto; min-height: 0; width: 100%; display: flex; flex-direction: column; }
.playroom-back { position: absolute; right: 0; bottom: 0; z-index: 35; margin: 0; }
.pr-menu {
  flex: 1 1 auto; min-height: 0; display: grid; align-items: center; gap: .6rem 1rem;
  grid-template-columns: minmax(190px, .9fr) minmax(0, 1.7fr);
  padding: .2rem 4.6rem .3rem .2rem;
}
.pr-host { display: flex; flex-direction: column; align-items: center; gap: .9rem; align-self: end; margin-bottom: .2rem; }
.pr-host .pr-bubble { max-width: 250px; }
.pr-bubble-btn { margin-top: .4rem; font-size: .9rem; padding: .3rem .8rem .34rem; }
.playroom-pet { height: min(44vh, 190px); }
.pr-games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; align-items: end; justify-items: center; }
body.world-zamek .hub-btn.cplq.pr-card { max-width: 168px; padding: .65rem .4rem .55rem; gap: .3rem; }
.pr-card .cplq-win { width: 98px; height: 96px; }
.pr-card .cplq-lab { font-size: 1rem; }
.pr-card-sub { font-size: .76rem; font-weight: 800; color: #7A5A44; line-height: 1; margin-top: -.05rem; }
.pr-card:nth-child(1) .cplq-win img { animation: cplayToy 3.2s ease-in-out infinite; }
.pr-card:nth-child(3) .cplq-win img { animation: eggRock 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes eggRock { 0%,70%,100% { transform: rotate(0); } 78% { transform: rotate(-8deg); } 86% { transform: rotate(7deg); } 93% { transform: rotate(-3deg); } }
@media (orientation: landscape) and (max-height: 500px) {
  .pr-card .cplq-win { width: 84px; height: 80px; }
  .playroom-pet { height: min(42vh, 150px); }
  .pr-bubble { font-size: .9rem; padding: .38rem .7rem .45rem; }
}
@media (orientation: portrait) {
  .pr-menu { grid-template-columns: 1fr; grid-template-rows: 1fr auto; padding: .4rem .1rem 5.4rem; align-items: end; }
  .pr-host { align-self: end; }
  .pr-games { gap: .45rem; }
  body.world-zamek .hub-btn.cplq.pr-card { max-width: 124px; padding: .5rem .25rem .45rem; }
  .pr-card .cplq-win { width: 78px; height: 76px; }
  .pr-card .cplq-lab { font-size: .76rem; padding: .1rem .4rem .14rem; white-space: normal; text-align: center; line-height: 1.05; }
  .pr-card-sub { font-size: .68rem; }
  .playroom-pet { height: min(28vh, 220px); }
}

/* ==========================================================================
   Mini-game chrome: HUD (progress gems · question plaque · streak)
   ========================================================================== */
.pr-hud {
  position: relative; z-index: 6; flex: 0 0 auto;
  display: grid; align-items: start; gap: .3rem .6rem;
  grid-template-columns: minmax(70px, 1fr) minmax(0, auto) minmax(70px, 1fr);
  grid-template-areas: "dots plaque streak";
  padding: .1rem .2rem 0;
}
.pr-dots { grid-area: dots; display: flex; gap: 5px; align-items: center; padding-top: .55rem; flex-wrap: wrap; }
.pr-dots i {
  width: 13px; height: 13px; border-radius: 50%; display: block;
  background: rgba(255, 250, 238, .85); box-shadow: inset 0 0 0 2px #C99A3C, 0 1px 0 #8E6420;
  transition: background .3s ease, transform .3s ease;
}
.pr-dots i.is-done { background: radial-gradient(circle at 35% 30%, #FFF6C8 0 20%, #F2C24E 50%, #C98A1E 100%); box-shadow: 0 0 0 1.5px #8E6420, 0 1px 0 #6E4A16; }
.pr-dots i.is-now { background: radial-gradient(circle at 35% 30%, #E9D5FF 0 20%, #A465D6 55%, #5A2370 100%); box-shadow: 0 0 0 1.5px #E9C46A; transform: scale(1.25); }
.pr-plaque {
  grid-area: plaque; justify-self: center; text-align: center; position: relative;
  min-width: 220px; max-width: 560px;
  background: linear-gradient(180deg, #FFFDF6 0%, #F4E4C6 100%);
  border: 3px solid #C99A3C; border-radius: 18px;
  box-shadow: inset 0 0 0 2px #FFF6DE, 0 4px 0 #8E6420, 0 10px 18px rgba(74,31,92,.22);
  padding: .3rem 1.1rem .38rem;
  color: #4A1F5C;
}
.pr-q { display: flex; flex-direction: column; align-items: center; gap: .05rem; }
.pr-eq { font-size: 2.05rem; font-weight: 800; line-height: 1.05; letter-spacing: .02em; color: #4A1F5C; white-space: nowrap; }
.pr-eq i { font-style: normal; color: #C98A1E; margin: 0 .08em; }
.pr-eq u { text-decoration: none; color: #B8306A; display: inline-block; min-width: .9em; animation: qPulse 1.3s ease-in-out infinite; }
@keyframes qPulse { 50% { transform: scale(1.15); } }
.pr-eq--sm { font-size: 1.32rem; margin-top: .08rem; }
.pr-say { font-size: 1.02rem; font-weight: 700; line-height: 1.25; }
.pr-say em { font-style: normal; font-weight: 800; color: #B8306A; font-size: 1.12em; }
.pr-hint {
  font-size: .86rem; font-weight: 800; color: #8E4A10; line-height: 1.2;
  max-height: 0; opacity: 0; overflow: hidden; transition: max-height .3s ease, opacity .3s ease, margin .3s ease;
}
.pr-hint.is-on { max-height: 3em; opacity: 1; margin-top: .2rem; }
.pr-hint.is-on::before { content: "Podpowiedź: "; color: #A8741E; font-weight: 700; }
.pr-streak {
  grid-area: streak; justify-self: end; margin-top: .3rem;
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .7rem .22rem .4rem; border-radius: 999px;
  background: linear-gradient(180deg, #8E4FC0, #5A2370); color: #FFF3D6;
  box-shadow: inset 0 0 0 1.5px #E9C46A, 0 3px 0 #3A1248, 0 6px 10px rgba(58,18,72,.3);
  font-weight: 700; font-size: .9rem; white-space: nowrap;
  opacity: 0; transform: scale(.6); transition: opacity .25s ease, transform .3s cubic-bezier(.3,1.6,.5,1);
}
.pr-streak b { color: #FFE27A; font-size: 1.1em; }
.pr-streak svg { width: 18px; height: 22px; }
.pr-streak.is-on { opacity: 1; transform: none; }
.pr-streak.is-bump { animation: streakBump .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes streakBump { 40% { transform: scale(1.25) rotate(-4deg); } }
.pr-field { position: relative; flex: 1 1 auto; min-height: 0; z-index: 4; }
.pr-dragon { position: absolute; right: 78px; bottom: .1rem; z-index: 5; line-height: 0; pointer-events: none; }
.pr-dragon .pet-sprite { pointer-events: auto; }
.pr-dragon .playroom-pet { height: min(42vh, 170px); }
.pet-sprite.is-fire { animation: petFire .6s ease; }
@keyframes petFire { 0%,100% { transform: none; } 30% { transform: translateX(6px) scale(1.04, .96); } 55% { transform: translateX(-8px) scale(.97, 1.04); } }
.pr-praise {
  position: absolute; left: 50%; top: 34%; z-index: 20; pointer-events: none; white-space: nowrap;
  font-size: 2.5rem; font-weight: 800; color: #FFE27A;
  -webkit-text-stroke: 2px #5A2370; paint-order: stroke fill;
  text-shadow: 0 4px 0 #3A1248, 0 0 18px rgba(255, 210, 110, .6);
  opacity: 0; transform: translate(-50%, -50%) scale(.4);
}
.pr-praise.is-show { animation: praisePop 1.05s cubic-bezier(.3,1.5,.5,1) forwards; }
@keyframes praisePop {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.4); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  70% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -85%) scale(.95); }
}
.pr-intro {
  position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  padding: 0 14rem 3rem 1rem;
  background: radial-gradient(ellipse at 60% 60%, rgba(46,16,58,.15), rgba(46,16,58,.45));
  animation: fadeIn .3s ease;
}
.pr-intro ~ .pr-dragon, .pr-game .pr-intro + * { z-index: 31; }
.pr-game:not(.is-on) .pr-dragon { z-index: 31; }
.pr-bubble--intro { max-width: 430px; font-size: 1.12rem; padding: .7rem 1.1rem .8rem; }
.pr-bubble--intro::after { left: auto; right: -10px; bottom: 30%; transform: rotate(-45deg); }
.pr-go { display: flex; margin: .6rem auto 0; font-size: 1.2rem; padding: .5rem 1.8rem .55rem; animation: cplayBreath 2s ease-in-out infinite; }
.pr-game:not(.is-on) .pr-hud { opacity: .35; filter: saturate(.6); }

/* —— end card —— */
.pr-end {
  position: absolute; inset: 0; z-index: 40; display: grid; place-items: center;
  background: rgba(46, 16, 58, .42); animation: fadeIn .3s ease;
}
.pr-end-card {
  text-align: center; min-width: 260px; max-width: 90%;
  background: linear-gradient(180deg, #FFFBF1 0%, #F4E4C6 100%);
  border: 3px solid #C99A3C; border-radius: 24px;
  box-shadow: inset 0 0 0 3px #FFF6DE, inset 0 0 0 5px rgba(201,154,60,.4), 0 6px 0 #8E6420, 0 24px 48px rgba(30,10,50,.4);
  padding: .8rem 1.6rem 1rem; animation: pop .45s cubic-bezier(.3,1.6,.5,1);
}
.pr-end-card h2 { margin: 0; font-size: 2.2rem; color: #4A1F5C; line-height: 1.05; text-shadow: 0 2px 0 #fff; }
.pr-end-coins { margin: .2rem 0 .1rem; font-size: 2rem; font-weight: 800; color: #A8741E; display: flex; align-items: center; justify-content: center; gap: .35rem; }
.pr-end-coins .ci { height: 1.5em; animation: purseCoin 1s ease .3s 2; }
.pr-end-line { margin: 0 0 .7rem; color: #7A5A44; font-weight: 700; font-size: .98rem; }
.pr-end-btns { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }

/* ==========================================================================
   (a) Ogniste balony
   ========================================================================== */
.pr-balloon {
  position: absolute; width: clamp(76px, 10.5vw, 104px); margin-left: calc(clamp(76px, 10.5vw, 104px) / -2);
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer; line-height: 0;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  animation: balloonIn .7s cubic-bezier(.3,1.3,.5,1) var(--d, 0s) both;
}
@keyframes balloonIn { from { transform: translateY(70vh); opacity: 0; } to { transform: none; opacity: 1; } }
.pr-balloon-in { display: block; position: relative; animation: balloonSway var(--sw, 3.4s) ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes balloonSway { 0% { transform: translateY(0) rotate(-3deg); } 100% { transform: translateY(-9px) rotate(3deg); } }
.pr-balloon img {
  width: 100%; height: auto; display: block; pointer-events: none; user-select: none;
  filter: hue-rotate(var(--h, 0deg)) saturate(1.05) drop-shadow(0 6px 6px rgba(60, 25, 70, .28));
  transition: transform .18s ease, opacity .18s ease, filter .3s ease;
}
.pr-balloon b {
  position: absolute; left: 0; right: 0; top: 37%; transform: translateY(-50%);
  text-align: center; font-size: clamp(1.7rem, 3.6vw, 2.15rem); font-weight: 800; line-height: 1;
  color: #fff; -webkit-text-stroke: 5px #4A1F5C; paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(58, 18, 72, .45);
  transition: opacity .15s ease;
}
.pr-balloon-in::after {
  content: ""; position: absolute; left: 50%; top: 99%; width: 2px; height: 34px; margin-left: -1px;
  background: linear-gradient(180deg, rgba(120, 90, 110, .8), rgba(120, 90, 110, 0));
  border-radius: 2px; transform-origin: 50% 0; animation: stringWave 1.8s ease-in-out infinite alternate;
}
@keyframes stringWave { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
.pr-balloon:active .pr-balloon-in img { transform: scale(.95); }
.pr-balloon.is-pop img { transform: scale(1.5); opacity: 0; }
.pr-balloon.is-pop b, .pr-balloon.is-pop .pr-balloon-in::after { opacity: 0; }
.pr-balloon.is-away { transition: transform .7s ease-in, opacity .7s ease-in; transform: translateY(-60vh); opacity: 0; animation: none; }
.pr-balloon.is-dud { cursor: default; }
.pr-balloon.is-dud .pr-balloon-in { animation: dudWobble .6s ease, balloonSway var(--sw, 3.4s) ease-in-out .6s infinite alternate; }
.pr-balloon.is-dud img { filter: hue-rotate(var(--h, 0deg)) grayscale(.75) brightness(.92) drop-shadow(0 4px 4px rgba(60,25,70,.2)); opacity: .55; }
.pr-balloon.is-dud b { opacity: .5; }
.pr-balloon.is-dud .pr-balloon-in::before {
  content: ""; position: absolute; left: 20%; right: 20%; top: 10%; height: 40%; z-index: 2; pointer-events: none;
  background: radial-gradient(circle at 30% 60%, rgba(160,150,170,.7) 0 18%, transparent 30%), radial-gradient(circle at 60% 40%, rgba(170,160,180,.6) 0 22%, transparent 34%), radial-gradient(circle at 75% 70%, rgba(150,140,160,.5) 0 14%, transparent 26%);
  filter: blur(2px); animation: smokeUp 1.4s ease-out forwards;
}
@keyframes dudWobble { 20% { transform: rotate(-10deg); } 45% { transform: rotate(8deg); } 70% { transform: rotate(-4deg); } }
.pr-balloon.is-hint img { filter: hue-rotate(var(--h, 0deg)) drop-shadow(0 0 10px #FFE27A) drop-shadow(0 0 4px #F2C24E) drop-shadow(0 6px 6px rgba(60,25,70,.28)); }
.pr-balloon.is-hint .pr-balloon-in { animation: hintBob .8s ease-in-out infinite alternate; }
@keyframes hintBob { from { transform: translateY(0) scale(1); } to { transform: translateY(-12px) scale(1.06); } }
.pr-fireball {
  position: fixed; z-index: 95; width: 34px; height: 34px; pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--a, 0deg)) scale(.5);
  border-radius: 50%;
  background: radial-gradient(circle at 55% 50%, #fff 0 18%, #FFF2A8 30%, #FFC24A 52%, #FF6A2A 76%, rgba(230, 60, 30, 0) 100%);
  box-shadow: 0 0 16px 6px rgba(255, 170, 60, .6);
  transition: left .38s cubic-bezier(.4,0,.7,1), top .38s cubic-bezier(.4,0,.7,1), transform .38s ease, opacity .3s ease;
}
.pr-fireball::after {
  content: ""; position: absolute; right: 50%; top: 50%; width: 60px; height: 18px; margin-top: -9px;
  border-radius: 50% 0 0 50%;
  background: linear-gradient(90deg, rgba(255,120,40,0), rgba(255,150,50,.75) 70%, rgba(255,220,120,.9));
  filter: blur(1.5px);
}
.pr-fireball.is-go { transform: translate(-50%, -50%) rotate(var(--a, 0deg)) scale(1); }
.pr-fireball.is-hit { transform: translate(-50%, -50%) scale(2.4); opacity: 0; transition: transform .3s ease-out, opacity .3s ease-out; }
.pr-fireball.is-hit::after { opacity: 0; }
.pr-shard {
  position: absolute; width: 10px; height: 10px; border-radius: 3px; z-index: 8; pointer-events: none;
  transform: translate(-50%, -50%); animation: shardFly .7s cubic-bezier(.2,.7,.4,1) forwards;
  box-shadow: 0 1px 1px rgba(60,25,70,.3);
}
@keyframes shardFly { to { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) rotate(220deg) scale(.4); opacity: 0; } }

/* ==========================================================================
   (b) Rozdaj owoce
   ========================================================================== */
.pr-field--fruit {
  display: flex; align-items: flex-end; justify-content: center; gap: .6rem 1.2rem;
  padding: .3rem 250px .4rem 0; flex-wrap: wrap; align-content: flex-end;
}
.pr-pile { position: relative; width: 96px; height: 82px; flex: 0 0 auto; align-self: flex-end; margin-bottom: .3rem; transition: opacity .3s ease; }
.pr-pile::before {
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -4px; height: 16px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(80,40,40,.28), transparent 70%);
}
.pr-pile img { position: absolute; width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(60,30,20,.35)); }
.pr-pile img:nth-child(1) { left: 0; bottom: 0; }
.pr-pile img:nth-child(2) { left: 26px; bottom: 2px; }
.pr-pile img:nth-child(3) { left: 52px; bottom: 0; }
.pr-pile img:nth-child(4) { left: 13px; bottom: 30px; }
.pr-pile img:nth-child(5) { left: 40px; bottom: 32px; }
.pr-field.is-ask .pr-pile { opacity: .35; }
.pr-baskets { display: flex; gap: .7rem; align-items: flex-end; justify-content: center; }
.pr-basket {
  appearance: none; border: 0; background: none; padding: var(--bpad, 52px) 0 0; margin: 0; cursor: pointer;
  position: relative; width: clamp(92px, 12.5vw, 124px); line-height: 0;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform .15s ease;
}
.pr-basket:active { transform: scale(.96); }
.pr-basket-img { position: relative; z-index: 2; width: 100%; height: auto; display: block; pointer-events: none; filter: drop-shadow(0 6px 5px rgba(60,30,20,.3)); transition: filter .3s ease; }
.pr-basket-fruits {
  position: absolute; z-index: 3; left: 12%; right: 12%; bottom: calc((100% - var(--bpad, 52px)) * .6); pointer-events: none;
  display: flex; flex-wrap: wrap-reverse; justify-content: center; align-content: flex-start; gap: 0 2%;
}
.pr-basket-fruits img {
  width: 28%; height: auto; aspect-ratio: 1; object-fit: contain; margin-top: -12%; pointer-events: auto;
  filter: drop-shadow(0 2px 1px rgba(60,30,20,.35));
  animation: fruitDrop .3s cubic-bezier(.3,1.6,.5,1) both;
}
.pr-basket-fruits img:last-child { animation: fruitDrop .32s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes fruitDrop { from { transform: translateY(-40%) scale(.6); opacity: .4; } to { transform: none; opacity: 1; } }
.pr-basket-n {
  position: absolute; z-index: 3; right: -4px; bottom: 10%; min-width: 30px; height: 30px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 999px;
  font-size: 1.05rem; font-weight: 800; line-height: 1; color: #FFF3D6;
  background: linear-gradient(180deg, #8E4FC0, #5A2370);
  box-shadow: inset 0 0 0 1.5px #E9C46A, 0 2px 0 #3A1248;
  transition: background .3s ease;
}
.pr-basket.is-full .pr-basket-n { background: linear-gradient(180deg, #9BDA6A, #4E9A2A); box-shadow: inset 0 0 0 1.5px #fff, 0 2px 0 #2E6A1E; }
.pr-basket.is-full .pr-basket-img { filter: drop-shadow(0 0 8px rgba(255, 226, 122, .95)) drop-shadow(0 6px 5px rgba(60,30,20,.3)); }
.pr-basket.is-wob { animation: dudWobble .5s ease; }
.pr-basket.is-cheer { animation: petHop .7s cubic-bezier(.3,.8,.4,1); }
.pr-fly-fruit {
  position: fixed; z-index: 95; width: 42px; height: 42px; object-fit: contain; pointer-events: none;
  transform: translate(-50%, -50%) scale(1.1); filter: drop-shadow(0 4px 3px rgba(60,30,20,.35));
  transition: left .28s cubic-bezier(.3,0,.7,1), top .28s cubic-bezier(.2,-.6,.7,1), transform .28s ease;
}
.pr-fly-fruit.is-go { transform: translate(-50%, -50%) scale(.8) rotate(160deg); }
.pr-choices { display: none; gap: .8rem; justify-content: center; align-items: center; width: 100%; flex: 0 0 100%; }
.pr-choices.is-on { display: flex; animation: fadeIn .3s ease; }
.pr-medal {
  appearance: none; cursor: pointer; font-family: var(--font);
  width: 66px; height: 66px; border-radius: 50%; padding: 0;
  font-size: 1.7rem; font-weight: 800; color: #4A1F5C; text-shadow: 0 1px 0 rgba(255,255,255,.7);
  border: 3px solid #A8741E;
  background: radial-gradient(circle at 35% 28%, #FFF8D8 0 16%, #F7D46A 48%, #D9A23A 100%);
  box-shadow: inset 0 0 0 3px rgba(255, 246, 210, .6), 0 4px 0 #6E4A16, 0 8px 12px rgba(74,31,92,.25);
  transition: transform .15s ease, opacity .2s ease, filter .2s ease;
}
.pr-medal:active { transform: translateY(3px); }
.pr-medal.is-good, .pr-eggbtn.is-good { animation: goodPop .6s cubic-bezier(.3,1.6,.5,1); filter: drop-shadow(0 0 10px rgba(155, 218, 106, .95)); }
@keyframes goodPop { 40% { transform: scale(1.25); } }
.pr-medal.is-dud, .pr-eggbtn.is-dud { opacity: .4; filter: grayscale(.8); animation: dudWobble .5s ease; cursor: default; }
.pr-medal.is-hint, .pr-eggbtn.is-hint { animation: hintBob .8s ease-in-out infinite alternate; filter: drop-shadow(0 0 10px #FFE27A) drop-shadow(0 0 3px #F2C24E); }

/* ==========================================================================
   (c) Smocze jajka
   ========================================================================== */
.pr-field--egg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem; padding: .2rem 250px .3rem 0; }
.pr-nest {
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  padding: .55rem 1.1rem .65rem; border-radius: 46px;
  background:
    repeating-linear-gradient(28deg, rgba(150, 100, 40, .12) 0 3px, transparent 3px 9px),
    repeating-linear-gradient(-32deg, rgba(150, 100, 40, .1) 0 2px, transparent 2px 8px),
    radial-gradient(ellipse at 50% 35%, #FFF1D2 0, #EBCF98 62%, #CFA761 100%);
  border: 3px solid #B98A3E;
  box-shadow: inset 0 5px 10px rgba(120,70,20,.3), inset 0 -3px 0 rgba(255,255,255,.35), 0 4px 0 #8E6420, 0 10px 16px rgba(74,31,92,.2);
}
.pr-egg-row { display: flex; gap: 14px; }
.pr-five { display: flex; gap: 3px; }
.pr-egg { width: 30px; height: 38px; display: block; position: relative; }
.pr-egg img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 2px 1px rgba(90,50,20,.35)); }
.pr-egg.is-new img { filter: hue-rotate(230deg) saturate(1.2) drop-shadow(0 2px 1px rgba(90,50,20,.35)); }
.pr-egg.is-new { animation: eggDrop .5s cubic-bezier(.3,1.5,.5,1) calc(.4s + var(--i) * .13s) both; }
@keyframes eggDrop { from { transform: translateY(-60px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.pr-egg.is-hatched { animation: eggHatch 1.1s ease calc(.4s + var(--g) * .14s) forwards; }
.pr-egg.is-hatched::after {
  content: ""; position: absolute; left: 10%; right: 10%; top: 38%; height: 18%; opacity: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 8'%3E%3Cpath d='M1 4l4-3 4 5 4-5 4 5 4-5 4 5 4-3' fill='none' stroke='%235A2370' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% 100% no-repeat;
  animation: crackShow 1.1s ease calc(.4s + var(--g) * .14s) forwards;
}
@keyframes eggHatch {
  0% { transform: none; opacity: 1; }
  15%, 35% { transform: rotate(-12deg); } 25%, 45% { transform: rotate(12deg); }
  60% { transform: none; opacity: 1; }
  100% { transform: scale(.82); opacity: .28; filter: grayscale(.6); }
}
@keyframes crackShow { 0%, 40% { opacity: 0; } 55%, 100% { opacity: 1; } }
.pr-egg.is-wiggle { animation: petHop .6s cubic-bezier(.3,.8,.4,1); }
.pr-bigegg img { width: 118px; height: auto; display: block; animation: eggRock 2.2s ease-in-out infinite; transform-origin: 50% 90%; filter: drop-shadow(0 6px 6px rgba(60,25,70,.3)); }
.pr-engine .q-main { font-size: 2rem; margin: .1rem 0 0; color: #4A1F5C; }
.pr-engine .q-main span { color: #4A1F5C !important; text-shadow: none !important; }
.pr-engine .q-main .n-lime, .pr-engine .q-main .n-pink { color: #C98A1E !important; }
.pr-engine .q-main .slot { color: #B8306A !important; }
.pr-eggbtn {
  appearance: none; border: 0; cursor: pointer; font-family: var(--font); padding: 0;
  width: 76px; height: 96px; display: grid; place-items: center;
  background: url('art/gra-jajo.png') center / contain no-repeat;
  filter: drop-shadow(0 5px 4px rgba(60,25,70,.3));
  transition: transform .15s ease, opacity .2s ease;
}
.pr-eggbtn span {
  font-size: 1.75rem; font-weight: 800; color: #4A1F5C; margin-top: 10%;
  -webkit-text-stroke: 4px #fff; paint-order: stroke fill;
}
.pr-eggbtn:active { transform: translateY(3px) scale(.96); }
.pr-field--egg .pr-choices { flex: 0 0 auto; gap: 1.2rem; }

/* —— game layout tuning —— */
@media (orientation: landscape) and (max-height: 500px) {
  .pr-eq { font-size: 1.75rem; }
  .pr-eq--sm { font-size: 1.12rem; }
  .pr-say { font-size: .9rem; }
  .pr-plaque { padding: .22rem .9rem .28rem; max-width: 470px; }
  .pr-dragon .playroom-pet { height: min(40vh, 150px); }
  .pr-egg { width: 25px; height: 32px; }
  .pr-eggbtn { width: 62px; height: 78px; }
  .pr-eggbtn span { font-size: 1.45rem; }
  .pr-medal { width: 58px; height: 58px; font-size: 1.5rem; }
  .pr-basket { --bpad: 44px; width: clamp(80px, 11vw, 108px); }
  .pr-field--fruit, .pr-field--egg { padding-right: 230px; }
  .pr-field--egg { gap: .45rem; }
  .pr-intro { padding-right: 12rem; }
  .pr-bubble--intro { font-size: 1rem; }
}
@media (orientation: portrait) {
  .pr-hud { grid-template-columns: 1fr auto; grid-template-areas: "dots streak" "plaque plaque"; }
  .pr-dots { padding-top: .2rem; }
  .pr-streak { margin-top: 0; }
  .pr-plaque { min-width: 0; width: 100%; }
  .pr-dragon { right: auto; left: .2rem; bottom: .2rem; transform: scaleX(-1); }
  .pr-dragon .playroom-pet { height: min(25vh, 200px); }
  .pr-field--fruit, .pr-field--egg { padding: .5rem .1rem 190px; }
  .pr-field--fruit { align-content: center; }
  .pr-baskets { flex-wrap: wrap; max-width: 330px; gap: .6rem 1.2rem; }
  .pr-basket { width: 116px; }
  .pr-intro { padding: 0 1rem 13rem; align-items: flex-end; }
  .pr-bubble--intro::after { right: auto; left: 22%; bottom: -10px; transform: rotate(45deg); }
  .pr-egg { width: 27px; height: 34px; }
  .pr-egg-row { gap: 10px; }
}

/* landscape: game card labels may wrap */
.pr-card .cplq-lab { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* —— portrait castle hub: plaques in the corners, pet centre, hero full width below —— */
@media (orientation: portrait) {
  body.world-zamek .hub-screen .hub-stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
  }
  body.world-zamek .hub-screen .hub-col-c { display: contents; }
  body.world-zamek .hub-screen .hub-col-l { grid-column: 1; grid-row: 1; justify-content: space-evenly; }
  body.world-zamek .hub-screen .hub-col-r { grid-column: 3; grid-row: 1; justify-content: space-evenly; }
  body.world-zamek .hub-screen .hub-pet { grid-column: 2; grid-row: 1; align-self: center; justify-self: center; z-index: 2; }
  body.world-zamek .hub-screen .hub-pet-img { height: min(27vh, 240px); }
  body.world-zamek .hub-screen .hub-btn.cplay { grid-column: 1 / -1; grid-row: 2; justify-self: center; width: min(100%, 320px); margin: 1.2rem 0 .6rem; }
}
