/* Demontaż v21: LCD 1:1 jak w Układaniu / szkicu użytkownika + celebracja v19.
   Mechanika gry pozostaje bez zmian.
   UWAGA: ten arkusz musi być ładowany po puzzle-games-layout-v6.css. */

/* Nie pokazujemy tekstowych podpowiedzi/statusów pod grą. Pomoc zostaje pod przyciskiem Instrukcja. */
body.pz-demontaz-page .pz-control-message,
body.pz-demontaz-page .pz-game-status.pz-retro-status,
body.pz-demontaz-page .pz-demontaz-board-tip{
  display:none!important;
}

/* LCD: NAPIS bezpośrednio nad LICZBĄ, całość wyśrodkowana jako jeden blok. */
body.pz-demontaz-page .pz-retro-lcd-slot .pz-retro-stat,
body.pz-demontaz-page .pz-retro-bottom-lcd .pz-retro-stat-mirror{
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  box-sizing:border-box!important;
  padding:3% 4%!important;
  margin:0!important;
  display:grid!important;
  grid-template-columns:100%!important;
  grid-template-rows:max-content max-content!important;
  place-content:center!important;
  justify-items:center!important;
  align-items:center!important;
  row-gap:0!important;
  overflow:hidden!important;
  text-align:center!important;
}
body.pz-demontaz-page .pz-retro-lcd-slot .pz-retro-stat span,
body.pz-demontaz-page .pz-retro-bottom-lcd .pz-retro-stat-mirror__label{
  position:static!important;
  flex:none!important;
  width:auto!important;
  max-width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  display:block!important;
  align-self:end!important;
  justify-self:center!important;
  text-align:center!important;
  line-height:.88!important;
  letter-spacing:.01em!important;
  font-weight:1000!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  transform:none!important;
}
body.pz-demontaz-page .pz-retro-lcd-slot .pz-retro-stat b,
body.pz-demontaz-page .pz-retro-bottom-lcd .pz-retro-stat-mirror__value{
  position:static!important;
  flex:none!important;
  width:auto!important;
  max-width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  display:block!important;
  align-self:start!important;
  justify-self:center!important;
  text-align:center!important;
  line-height:.88!important;
  letter-spacing:.01em!important;
  font-weight:1000!important;
  white-space:nowrap!important;
  overflow:visible!important;
  text-overflow:clip!important;
  transform:none!important;
  font-variant-numeric:tabular-nums!important;
}
body.pz-demontaz-page.pz-retro-ui-v6 .pz-retro-stat span,
body.pz-demontaz-page.pz-retro-ui-v6 .pz-retro-stat-mirror__label,
body.pz-demontaz-page.pz-retro-ui-v6 .pz-retro-stat b,
body.pz-demontaz-page.pz-retro-ui-v6 .pz-retro-stat-mirror__value{
  flex-basis:auto!important;
}

/* Celebracja w tym samym języku wizualnym co Układanie v31. */
body.pz-demontaz-page .pz-demontaz-complete{
  background:
    radial-gradient(circle at 50% 43%,rgba(255,244,186,.18),transparent 42%),
    rgba(250,247,240,.34)!important;
  backdrop-filter:blur(.65px) saturate(.96)!important;
  -webkit-backdrop-filter:blur(.65px) saturate(.96)!important;
  padding:clamp(10px,2.2vw,24px)!important;
  overflow:hidden!important;
}
html[data-theme="dark"] body.pz-demontaz-page .pz-demontaz-complete{
  background:
    radial-gradient(circle at 50% 43%,rgba(255,182,78,.12),transparent 42%),
    rgba(11,14,17,.42)!important;
}
body.pz-demontaz-page .pz-demontaz-complete .pz-win-result-card.pz-dem19-win{
  position:relative;
  z-index:3;
  width:min(92%,620px);
  max-height:94%;
  display:flex!important;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:clamp(7px,1.25vh,14px)!important;
  margin:0 auto!important;
  padding:clamp(8px,1.4vw,18px)!important;
  border:0!important;
  border-radius:24px;
  background:transparent!important;
  box-shadow:none!important;
  color:#20242a;
  overflow:visible;
  isolation:isolate;
}
html[data-theme="dark"] body.pz-demontaz-page .pz-demontaz-complete .pz-dem19-win{color:#f3f5f7;}
body.pz-demontaz-page .pz-dem19-finish-head{
  display:flex!important;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:clamp(6px,1vh,12px)!important;
  margin:0!important;
  width:100%;
}
body.pz-demontaz-page .pz-dem19-completed{
  width:min(76%,390px)!important;
  max-height:clamp(94px,20vh,176px)!important;
  height:auto!important;
  object-fit:contain;
  filter:drop-shadow(0 10px 13px rgba(0,0,0,.24))!important;
  transform-origin:center;
  animation:pzDem19CompletedPop .54s cubic-bezier(.18,.92,.25,1.25) both;
}
body.pz-demontaz-page .pz-dem19-awards{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:clamp(8px,2.2vw,24px);
  min-height:clamp(104px,19vh,170px);
}
body.pz-demontaz-page .pz-dem19-score30{
  width:min(40%,210px);
  max-height:clamp(74px,15vh,132px);
  height:auto;
  object-fit:contain;
  filter:drop-shadow(0 7px 10px rgba(0,0,0,.20));
  transform-origin:center;
  animation:pzDem19ScorePop .48s cubic-bezier(.16,.9,.23,1.25) .18s both;
}
body.pz-demontaz-page .pz-dem19-trophy-stage{
  position:relative;
  width:clamp(118px,23vw,190px);
  height:clamp(104px,19vh,168px);
  display:grid;
  place-items:center;
  transform-origin:50% 92%;
  animation:pzDem19TrophyLand .72s cubic-bezier(.17,.94,.27,1.34) .34s both;
}
body.pz-demontaz-page .pz-dem19-trophy-stage::before,
body.pz-demontaz-page .pz-dem19-trophy-stage::after{
  content:"";
  position:absolute;
  inset:3% 0 0;
  border-radius:50%;
  pointer-events:none;
}
body.pz-demontaz-page .pz-dem19-trophy-stage::before{
  background:repeating-conic-gradient(from 0deg,rgba(255,194,37,0) 0 9deg,rgba(255,194,37,.30) 10deg 13deg,rgba(255,194,37,0) 14deg 28deg);
  -webkit-mask:radial-gradient(circle,transparent 0 30%,#000 31% 61%,transparent 62%);
  mask:radial-gradient(circle,transparent 0 30%,#000 31% 61%,transparent 62%);
  animation:pzDem19Rays 4.5s linear 1s infinite;
  opacity:.72;
}
body.pz-demontaz-page .pz-dem19-trophy-glow{
  position:absolute;
  width:86%;height:72%;
  border-radius:50%;
  background:radial-gradient(circle,rgba(255,226,103,.56) 0,rgba(255,177,45,.18) 48%,transparent 72%);
  filter:blur(3px);
  animation:pzDem19Glow 1.35s ease-in-out .7s 2 alternate;
}
body.pz-demontaz-page .pz-dem19-trophy{
  position:relative;
  z-index:2;
  width:100%;
  max-width:190px;
  height:100%;
  max-height:168px;
  object-fit:contain;
  filter:drop-shadow(0 11px 9px rgba(73,40,0,.27));
  transform-origin:50% 88%;
  animation:pzDem19TrophyWiggle 1.15s ease-in-out 1.03s 2 both;
}
body.pz-demontaz-page .pz-dem19-trophy-stage::after{
  z-index:3;
  inset:8% 16% 10%;
  background:linear-gradient(105deg,transparent 20%,rgba(255,255,255,.78) 47%,transparent 70%);
  transform:translateX(-145%) skewX(-18deg);
  animation:pzDem19Shine 1s ease-out 1.05s 1 both;
  mix-blend-mode:screen;
}
body.pz-demontaz-page .pz-dem19-summary{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:clamp(5px,.9vh,9px);
  width:min(96%,560px);
  animation:pzDem19SummaryIn .48s ease-out .86s both;
}
body.pz-demontaz-page .pz-dem19-summary-title{
  display:block;
  margin:0!important;
  font-size:clamp(18px,3.1vw,30px)!important;
  line-height:1!important;
  font-weight:1000!important;
  letter-spacing:.055em!important;
  color:#20242a!important;
  text-align:center;
  text-shadow:0 1px 0 rgba(255,255,255,.6);
}
html[data-theme="dark"] body.pz-demontaz-page .pz-dem19-summary-title{color:#f2f4f6!important;text-shadow:0 1px 0 rgba(0,0,0,.28);}
body.pz-demontaz-page .pz-dem19-stats{
  width:100%;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(5px,1.1vw,10px);
}
body.pz-demontaz-page .pz-dem19-stat{
  min-width:0;
  padding:clamp(7px,1.1vh,11px) clamp(6px,1vw,10px);
  border:1px solid rgba(77,57,31,.18);
  border-radius:12px;
  background:rgba(255,250,239,.74);
  box-shadow:0 4px 12px rgba(44,31,14,.10);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  backdrop-filter:blur(2px);
}
html[data-theme="dark"] body.pz-demontaz-page .pz-dem19-stat{background:rgba(25,29,33,.78);border-color:rgba(255,255,255,.12);}
body.pz-demontaz-page .pz-dem19-stat span{
  margin:0!important;
  font-size:clamp(10px,1.55vw,14px)!important;
  line-height:1!important;
  font-weight:1000!important;
  letter-spacing:.09em!important;
  color:#5e574e!important;
}
html[data-theme="dark"] body.pz-demontaz-page .pz-dem19-stat span{color:#b8c0c7!important;}
body.pz-demontaz-page .pz-dem19-stat b{
  margin:0!important;
  font-size:clamp(21px,4.2vw,38px)!important;
  line-height:.98!important;
  font-weight:1000!important;
  color:#171b20!important;
  letter-spacing:.01em!important;
  font-variant-numeric:tabular-nums;
}
html[data-theme="dark"] body.pz-demontaz-page .pz-dem19-stat b{color:#fff!important;}
body.pz-demontaz-page .pz-dem19-record,
body.pz-demontaz-page .pz-dem19-clean{
  margin-top:1px;
  padding:5px 11px 4px;
  border-radius:999px;
  color:#fff;
  font-size:clamp(10px,1.45vw,13px);
  line-height:1;
  font-weight:1000;
  letter-spacing:.06em;
  box-shadow:0 5px 12px rgba(255,90,0,.25);
  animation:pzDem19RecordPop .46s cubic-bezier(.18,.9,.22,1.28) 1.16s both;
}
body.pz-demontaz-page .pz-dem19-record{background:#ff5a00;}
body.pz-demontaz-page .pz-dem19-clean{background:#3f9a4a;box-shadow:0 5px 12px rgba(63,154,74,.22);}
body.pz-demontaz-page .pz-demontaz-complete .pz-win-close{
  top:8px;right:8px;background:rgba(255,250,239,.84);backdrop-filter:blur(3px);
}
html[data-theme="dark"] body.pz-demontaz-page .pz-demontaz-complete .pz-win-close{background:rgba(24,28,32,.86);}

@keyframes pzDem19CompletedPop{0%{opacity:0;transform:translateY(-18px) scale(.76)}68%{opacity:1;transform:translateY(2px) scale(1.055)}100%{opacity:1;transform:none}}
@keyframes pzDem19ScorePop{0%{opacity:0;transform:translateY(14px) scale(.66) rotate(-3deg)}72%{opacity:1;transform:translateY(-2px) scale(1.06) rotate(1deg)}100%{opacity:1;transform:none}}
@keyframes pzDem19TrophyLand{0%{opacity:0;transform:translateY(-52px) scale(.48)}54%{opacity:1;transform:translateY(6px) scale(1.10)}72%{transform:translateY(-4px) scale(.97)}86%{transform:translateY(2px) scale(1.025)}100%{opacity:1;transform:none}}
@keyframes pzDem19TrophyWiggle{0%,100%{transform:rotate(0)}18%{transform:rotate(-8deg)}38%{transform:rotate(7deg)}58%{transform:rotate(-5deg)}78%{transform:rotate(3deg)}}
@keyframes pzDem19Rays{to{transform:rotate(360deg)}}
@keyframes pzDem19Glow{from{opacity:.48;transform:scale(.9)}to{opacity:1;transform:scale(1.08)}}
@keyframes pzDem19Shine{0%{opacity:0;transform:translateX(-145%) skewX(-18deg)}15%{opacity:1}100%{opacity:0;transform:translateX(145%) skewX(-18deg)}}
@keyframes pzDem19SummaryIn{0%{opacity:0;transform:translateY(16px)}100%{opacity:1;transform:none}}
@keyframes pzDem19RecordPop{0%{opacity:0;transform:scale(.62)}75%{opacity:1;transform:scale(1.08)}100%{opacity:1;transform:none}}

@media(max-width:820px) and (orientation:portrait){
  body.pz-demontaz-page .pz-demontaz-complete{padding:8px!important;}
  body.pz-demontaz-page .pz-dem19-completed{width:min(78%,330px)!important;max-height:126px!important;}
  body.pz-demontaz-page .pz-dem19-awards{min-height:100px;gap:5px;}
  body.pz-demontaz-page .pz-dem19-score30{width:min(44%,180px);max-height:100px;}
  body.pz-demontaz-page .pz-dem19-trophy-stage{width:clamp(105px,30vw,155px);height:clamp(92px,16vh,136px);}
  body.pz-demontaz-page .pz-dem19-trophy{max-width:155px;max-height:136px;}
  body.pz-demontaz-page .pz-dem19-summary{width:min(98%,470px);}
  body.pz-demontaz-page .pz-dem19-stat{padding:7px 4px;}
}
@media(max-height:650px) and (orientation:landscape){
  body.pz-demontaz-page .pz-dem19-win{gap:4px!important;padding:6px!important;}
  body.pz-demontaz-page .pz-dem19-completed{width:min(54%,300px)!important;max-height:86px!important;}
  body.pz-demontaz-page .pz-dem19-awards{min-height:82px;gap:5px;}
  body.pz-demontaz-page .pz-dem19-score30{width:min(28%,160px);max-height:76px;}
  body.pz-demontaz-page .pz-dem19-trophy-stage{width:104px;height:82px;}
  body.pz-demontaz-page .pz-dem19-trophy{max-width:104px;max-height:82px;}
  body.pz-demontaz-page .pz-dem19-summary-title{font-size:18px!important;}
  body.pz-demontaz-page .pz-dem19-stat{padding:5px 4px;}
  body.pz-demontaz-page .pz-dem19-stat b{font-size:20px!important;}
}
@media(prefers-reduced-motion:reduce){
  body.pz-demontaz-page .pz-dem19-completed,
  body.pz-demontaz-page .pz-dem19-score30,
  body.pz-demontaz-page .pz-dem19-trophy-stage,
  body.pz-demontaz-page .pz-dem19-trophy,
  body.pz-demontaz-page .pz-dem19-trophy-stage::before,
  body.pz-demontaz-page .pz-dem19-trophy-stage::after,
  body.pz-demontaz-page .pz-dem19-trophy-glow,
  body.pz-demontaz-page .pz-dem19-summary,
  body.pz-demontaz-page .pz-dem19-record,
  body.pz-demontaz-page .pz-dem19-clean{animation:none!important;}
}


/* ========================================================================
   v20 FINAL LCD OVERRIDE
   Każdy aktywny LCD ma jeden zwarty blok:
       NAPIS
       WARTOŚĆ
   Napis jest bezpośrednio nad cyframi, a cały blok jest centrowany pionowo
   i poziomo w szybie. Selektory są celowo bardziej specyficzne niż wspólny
   puzzle-games-layout-v6.css, aby nie wrócił podział 42% / 58%.
   ======================================================================== */
body.pz-game-page.pz-demontaz-page.pz-retro-ui-v6 .pz-retro-lcd-slot .pz-retro-stat,
body.pz-game-page.pz-demontaz-page.pz-retro-ui-v6 .pz-retro-bottom-lcd .pz-retro-stat-mirror{
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:100%!important;
  max-height:100%!important;
  box-sizing:border-box!important;
  margin:0!important;
  padding:3% 4%!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:max-content max-content!important;
  place-content:center!important;
  justify-items:center!important;
  align-items:center!important;
  row-gap:0!important;
  overflow:hidden!important;
  text-align:center!important;
}

body.pz-game-page.pz-demontaz-page.pz-retro-ui-v6 .pz-retro-lcd-slot .pz-retro-stat > span,
body.pz-game-page.pz-demontaz-page.pz-retro-ui-v6 .pz-retro-bottom-lcd .pz-retro-stat-mirror__label{
  position:static!important;
  inset:auto!important;
  flex:0 0 auto!important;
  flex-basis:auto!important;
  width:auto!important;
  max-width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  display:block!important;
  align-self:end!important;
  justify-self:center!important;
  text-align:center!important;
  line-height:.88!important;
  letter-spacing:.01em!important;
  font-weight:1000!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  transform:none!important;
  justify-content:center!important;
  align-items:center!important;
}

body.pz-game-page.pz-demontaz-page.pz-retro-ui-v6 .pz-retro-lcd-slot .pz-retro-stat > b,
body.pz-game-page.pz-demontaz-page.pz-retro-ui-v6 .pz-retro-bottom-lcd .pz-retro-stat-mirror__value{
  position:static!important;
  inset:auto!important;
  flex:0 0 auto!important;
  flex-basis:auto!important;
  width:auto!important;
  max-width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  display:block!important;
  align-self:start!important;
  justify-self:center!important;
  text-align:center!important;
  line-height:.88!important;
  letter-spacing:.01em!important;
  font-weight:1000!important;
  white-space:nowrap!important;
  overflow:visible!important;
  text-overflow:clip!important;
  transform:none!important;
  font-variant-numeric:tabular-nums!important;
  justify-content:center!important;
  align-items:center!important;
}

/* Nieaktywna czwarta dolna szybka pozostaje pusta. Nie dodajemy sztucznej statystyki. */
body.pz-game-page.pz-demontaz-page.pz-retro-ui-v6 .pz-retro-bottom-lcd:empty{
  overflow:hidden!important;
}


/* ========================================================================
   v21: startowy opis, Pomoc i czytelna granica pola obrazka
   ======================================================================== */
body.pz-demontaz-page .pz-dem21-intro{
  position:absolute;
  inset:0;
  z-index:905;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:clamp(12px,3vw,34px);
  pointer-events:none;
}
body.pz-demontaz-page .pz-dem21-intro[hidden]{display:none!important;}
body.pz-demontaz-page .pz-dem21-intro-card{
  width:min(560px,72%);
  padding:clamp(16px,2.5vw,26px) clamp(18px,3vw,30px);
  border:1px solid rgba(95,65,30,.22);
  border-radius:20px;
  background:rgba(255,250,239,.94);
  box-shadow:0 14px 40px rgba(49,35,19,.20),0 2px 7px rgba(49,35,19,.12);
  backdrop-filter:blur(5px);
  text-align:center;
  color:#24211d;
}
body.pz-demontaz-page .pz-dem21-intro-card strong{
  display:block;
  margin:0 0 9px;
  font-size:clamp(18px,2.3vw,29px);
  line-height:1.05;
  font-weight:1000;
}
body.pz-demontaz-page .pz-dem21-intro-card p{
  margin:7px 0 0;
  font-size:clamp(12px,1.35vw,17px);
  line-height:1.45;
  font-weight:700;
}
body.pz-demontaz-page .pz-dem21-intro-card span{
  display:block;
  margin-top:9px;
  font-size:clamp(12px,1.25vw,16px);
  line-height:1;
  font-weight:1000;
  font-style:italic;
}
html[data-theme="dark"] body.pz-demontaz-page .pz-dem21-intro-card{
  color:#f4f2ed;
  background:rgba(28,31,34,.94);
  border-color:rgba(255,255,255,.14);
  box-shadow:0 14px 42px rgba(0,0,0,.38);
}

/* Pole, z którego trzeba wyjąć puzzle: lekko uniesiona powierzchnia. */
body.pz-demontaz-page .pz-demontaz-origin{
  border:1.5px solid rgba(64,52,37,.30)!important;
  background:rgba(255,255,255,.085)!important;
  box-shadow:
    0 10px 24px rgba(53,40,24,.18),
    0 2px 7px rgba(53,40,24,.14),
    0 0 0 3px rgba(255,255,255,.18),
    inset 0 0 20px rgba(255,255,255,.09)!important;
}
body.pz-demontaz-page .pz-demontaz-origin>span{
  background:rgba(255,250,239,.86)!important;
  color:rgba(38,31,24,.72)!important;
  box-shadow:0 2px 6px rgba(48,35,20,.12);
}
html[data-theme="dark"] body.pz-demontaz-page .pz-demontaz-origin{
  border-color:rgba(255,255,255,.25)!important;
  background:rgba(255,255,255,.035)!important;
  box-shadow:0 11px 27px rgba(0,0,0,.38),0 0 0 3px rgba(255,255,255,.07),inset 0 0 20px rgba(255,255,255,.035)!important;
}

/* Ręczna podpowiedź: pracujemy na widocznym obrysie SVG, nie na transformacji puzzla. */
body.pz-demontaz-page .pz-real-piece.is-demontaz-help-hint .pz-real-piece__outline{
  stroke:#ff7a00!important;
  stroke-width:3.2!important;
  vector-effect:non-scaling-stroke;
  animation:pzDem21HintOutline .72s ease-in-out 4;
}
body.pz-demontaz-page .pz-real-piece.is-demontaz-help-hint .pz-real-piece__svg{
  filter:drop-shadow(0 0 7px rgba(255,122,0,.78)) drop-shadow(0 0 15px rgba(255,198,64,.34));
}
@keyframes pzDem21HintOutline{
  0%,100%{stroke:#ff7a00;stroke-width:2.4px;opacity:.72}
  50%{stroke:#ffd34d;stroke-width:4.4px;opacity:1}
}

@media(max-width:820px) and (orientation:portrait){
  body.pz-demontaz-page .pz-dem21-intro{padding:10px;align-items:flex-start;padding-top:17vh;}
  body.pz-demontaz-page .pz-dem21-intro-card{width:min(92%,480px);padding:14px 15px;border-radius:16px;}
  body.pz-demontaz-page .pz-dem21-intro-card strong{font-size:18px;}
  body.pz-demontaz-page .pz-dem21-intro-card p{font-size:12px;line-height:1.38;}
}
@media(prefers-reduced-motion:reduce){
  body.pz-demontaz-page .pz-real-piece.is-demontaz-help-hint .pz-real-piece__outline{animation:none!important;stroke:#ff7a00!important;stroke-width:4px!important;}
}


/* ========================================================================
   v22 - czytelniejsze opisy sterowania na górnym panelu
   ======================================================================== */
body.pz-demontaz-page.pz-retro-ui-v7 .pz-retro-caption{
  font-size:clamp(7.5px,.72vw,11px)!important;
  line-height:1!important;
  font-weight:1000!important;
  letter-spacing:.035em!important;
  text-shadow:0 1px 0 rgba(255,255,255,.24),0 0 1px rgba(0,0,0,.35);
}
body.pz-demontaz-page.pz-retro-ui-v7 .pz-retro-hint-button,
body.pz-demontaz-page.pz-retro-ui-v7 .pz-retro-hint-button .pz-retro-button__label{
  font-size:clamp(12px,1.1vw,17px)!important;
  line-height:1!important;
  font-weight:1000!important;
}
@media(max-width:820px) and (orientation:portrait){
  body.pz-demontaz-page.pz-retro-ui-v7 .pz-retro-caption{
    font-size:clamp(5.8px,1.8vw,8px)!important;
  }
  body.pz-demontaz-page.pz-retro-ui-v7 .pz-retro-hint-button,
  body.pz-demontaz-page.pz-retro-ui-v7 .pz-retro-hint-button .pz-retro-button__label{
    font-size:clamp(10px,3vw,14px)!important;
  }
}

/* ========================================================================
   v23 Natural Levels + Settled State
   ======================================================================== */
body.pz-demontaz-page .pz-real-piece.is-demontaz-lifted{
  filter:drop-shadow(0 13px 11px rgba(0,0,0,.28))!important;
  z-index:1200!important;
}
body.pz-demontaz-page .pz-real-piece.is-demontaz-bumped{
  transition:transform .10s ease-out!important;
}
body.pz-demontaz-page .pz-dem23-level-card{
  position:absolute;
  inset:0;
  z-index:2450;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:clamp(10px,2vh,18px);
  pointer-events:none;
  background:rgba(247,241,227,.18);
  backdrop-filter:blur(1.5px);
  opacity:0;
  transform:scale(.94);
  transition:opacity .18s ease,transform .22s cubic-bezier(.2,.9,.2,1.1);
}
body.pz-demontaz-page .pz-dem23-level-card.is-visible{opacity:1;transform:scale(1)}
body.pz-demontaz-page .pz-dem23-level-art{
  width:min(66%,720px);
  max-height:30vh;
  object-fit:contain;
  filter:drop-shadow(0 10px 12px rgba(0,0,0,.25));
}
body.pz-demontaz-page .pz-dem23-limit{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:clamp(8px,2vw,18px);
}
body.pz-demontaz-page .pz-dem23-limit img{
  width:min(34vw,260px);
  max-height:18vh;
  object-fit:contain;
  filter:drop-shadow(0 7px 9px rgba(0,0,0,.22));
}
body.pz-demontaz-page .pz-dem23-limit b{
  display:grid;
  place-items:center;
  min-width:5.2ch;
  padding:.35em .55em;
  border-radius:14px;
  border:3px solid rgba(26,24,18,.78);
  background:#cbd3a4;
  color:#171913;
  font:1000 clamp(24px,5vw,56px)/1 'Manrope',sans-serif;
  letter-spacing:.05em;
  box-shadow:inset 0 0 0 4px rgba(255,255,255,.18),0 7px 16px rgba(0,0,0,.18);
}
body.pz-demontaz-page .pz-demontaz-stage.is-demontaz-time-low{
  box-shadow:inset 0 0 0 3px rgba(215,47,36,.38),inset 0 0 42px rgba(215,47,36,.09)!important;
}
body.pz-demontaz-page .pz-dem23-finish-level{
  width:min(56%,360px);
  max-height:90px;
  object-fit:contain;
  margin-bottom:2px;
  filter:drop-shadow(0 5px 7px rgba(0,0,0,.16));
}
body.pz-demontaz-page .pz-dem23-reward{
  width:min(44%,250px);
  max-height:105px;
  object-fit:contain;
  margin-top:2px;
  filter:drop-shadow(0 6px 8px rgba(0,0,0,.20));
  animation:pzDem23Reward .48s cubic-bezier(.17,.9,.22,1.2) both;
}
body.pz-demontaz-page .pz-dem23-master{max-height:120px}
@keyframes pzDem23Reward{0%{opacity:0;transform:scale(.68) translateY(8px)}75%{opacity:1;transform:scale(1.05)}100%{opacity:1;transform:none}}

body.pz-demontaz-page .pz-demontaz-complete.is-dem23-fail{
  display:grid!important;
  place-items:center!important;
  background:rgba(245,238,222,.72)!important;
  backdrop-filter:blur(2px);
  z-index:2700!important;
}
body.pz-demontaz-page .pz-dem23-fail-card{
  width:min(92%,620px);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:clamp(10px,2vh,18px);
  padding:clamp(14px,3vw,28px);
}
body.pz-demontaz-page .pz-dem23-fail-main{width:min(74%,430px);max-height:190px;object-fit:contain;filter:drop-shadow(0 10px 13px rgba(0,0,0,.24))}
body.pz-demontaz-page .pz-dem23-fail-sub{width:min(70%,410px);max-height:160px;object-fit:contain;filter:drop-shadow(0 8px 10px rgba(0,0,0,.20))}
body.pz-demontaz-page #dem23RetryBtn{
  border:0;
  border-radius:999px;
  padding:.72em 1.25em;
  background:#ff5a00;
  color:#fff;
  font:900 clamp(15px,2vw,20px)/1 'Manrope',sans-serif;
  cursor:pointer;
  box-shadow:0 7px 15px rgba(255,90,0,.28);
}
body.pz-demontaz-page #dem23RetryBtn:hover{transform:translateY(-1px)}

@media(max-width:820px) and (orientation:portrait){
  body.pz-demontaz-page .pz-dem23-level-art{width:min(86%,620px);max-height:22vh}
  body.pz-demontaz-page .pz-dem23-limit{flex-direction:column;gap:5px}
  body.pz-demontaz-page .pz-dem23-limit img{width:min(56vw,230px);max-height:12vh}
  body.pz-demontaz-page .pz-dem23-finish-level{max-height:68px}
  body.pz-demontaz-page .pz-dem23-reward{max-height:82px}
}
@media(prefers-reduced-motion:reduce){
  body.pz-demontaz-page .pz-dem23-level-card,
  body.pz-demontaz-page .pz-dem23-reward{transition:none!important;animation:none!important}
}
