/* =========================================================
   HEADER + FOOTER persistente (start + intrebari)
   Fixate peste continut (full page), transparente.
   ========================================================= */

/* fiecare ecran ocupa cel putin viewport-ul MARE (bara de adresa ascunsa),
      ca sa nu apara spatiu gol cand bara se ascunde; nu se redimensioneaza la scroll */
   .site-shell .background {
     height: auto;
     min-height: 100vh;
     min-height: 100lvh;
   }
   
   /* intro-ul creste cu continutul, fara scroll intern */
   .intro-screen .popup-bg.intro {
     height: auto;
     min-height: 0;
     overflow: visible;
   }
   
   /* fara "bounce" pe iOS care arata albastrul de sub pagina */
   html, body {
     overscroll-behavior-y: none;
   }

/* ---------- HEADER ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;                 /* peste .background, sub popup-uri */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  pointer-events: none;        /* nu blocheaza click-urile de dedesubt */
  max-width: 100% !important;
}
.site-header > * { pointer-events: auto; }

/* .site-reg {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  background: #221F1D;
  padding: 11px 18px;
  border-radius: 10px;
  box-shadow: 0 4px 0 rgba(0,0,0,.3);
  text-decoration: none;
  line-height: 1;
}
.site-reg:hover, .site-reg:focus { color: #fff; }
.site-reg:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.3); } */

.site-brand img {
  display: block;
  height: 60px;
  width: auto;
  image-rendering: pixelated;
}

/* ---------- FOOTER ---------- */
.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  max-width: 100% !important;
}
.site-footer > * { pointer-events: auto; }

.site-app {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: #fff;
}
.site-app:hover, .site-app:focus { color: #fff; text-decoration: none }
.site-app__icon {
  width: 60px; height: 60px;
  flex: none;
  display: block;
  image-rendering: pixelated;
}
.site-app__text {
  font-size: 14px;
  line-height: 1.4;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0,0,0,.55);
}

.site-social {
  display: flex;
  gap: 10px;
}
.site-social a {
  display: block;
  width: 60px; height: 60px;
}
.site-social img {
  display: block;
  width: 100%; height: 100%;
  image-rendering: pixelated;
}
.site-social a:active { transform: translateY(2px); }

/* raspunsuri: tot textul aliniat dupa checkbox */
.nes-container.answer label {
  display: flex;
  align-items: flex-start;
  margin: 0;
}
.nes-container.answer label .nes-checkbox {
  flex: none;
}
.nes-container.answer label .nes-checkbox + span {
  flex: 1;
  min-width: 0;
}

/* =========================================================
   MOBIL (portret): fundal pe latime, ancorat jos,
   cer albastru deasupra, loc rezervat pentru scena
   ========================================================= */



@media (max-width: 810px) and (orientation: portrait) {
   
     .site-shell .background {
       /* --footer-h: 80px;                   inaltimea footer-ului pe 2 randuri  */
       --scene: calc(87vw + var(--footer-h)); /* scena din imagine + pamantul extins */
   
       background-size: 100% auto !important;
       background-position: center bottom var(--footer-h) !important; /* imaginea ridicata cat footer-ul */
       background-color: #4FB6E1 !important;
       min-height: 100lvh;
     }
     
     .site-shell {
       --footer-content: 84px;     /* footer height as a single row (601–810px) */
       --ground-img: 20.5vw;       /* ground already inside the bg image */
       --footer-h: max(8px, calc(var(--footer-content) + env(safe-area-inset-bottom, 0px) - var(--ground-img)));
     }
     
     /* doar pe intro: mai putin spatiu intre START si scena */
      .site-shell .background.intro-screen {
        --scene: calc(65vw + var(--footer-h));
      }
   
     /* pamant extins sub imagine, pe toata inaltimea footer-ului */
     .site-shell .background::after {
       content: "";
       position: absolute;
       left: 0; right: 0; bottom: 0;
       height: var(--footer-h);
       background: #60374E;               /* aceeasi culoare ca pamantul din imagine */
       z-index: 0;
       pointer-events: none;
     }
   
     .quiz-screen .wrapper {
       padding-bottom: var(--scene);
     }
     .intro-screen .popup-bg.intro {
       padding-bottom: var(--scene);
     }
   
     /* personajele de pe intro: pe iarba, deasupra pamantului extins */
     .intro-screen .intro-figure {
        bottom: calc(var(--footer-h) + var(--ground, 4vw));
      }
     .intro-screen {
       --ground: 20.5vw;   /* cat de sus e iarba fata de marginea de jos a imaginii */
     }
     /* ---- REZULTAT: cardul intra in pagina, nu mai e overlay ---- */
      .site-shell .popup-bg.quiz {
        position: relative;
        height: auto;
        overflow: visible;
        z-index: 2;
      }
      .site-shell .popup-bg.quiz .popup {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 0 auto;
      }
     
      /* cand apare rezultatul, spatiul pentru scena se muta sub card */
      .quiz-screen[class*="bgquiz_rasp"] .wrapper {
        padding-bottom: 0;
      }
      .quiz-screen[class*="bgquiz_rasp"] .popup-bg.quiz {
        padding-bottom: var(--scene);
      }
   }

/* ---------- MOBIL ---------- */
@media (max-width: 600px) {
  .site-header { padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  /* .site-reg { font-size: 11px; padding: 9px 12px; } */
  /* .site-brand img { height: 32px; } */
  
  .site-shell { --footer-content: 158px; }  /* stacked footer */

  .site-footer { padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); gap: 10px; }
  .site-app { gap: 8px; }
  .site-app__text { font-size: 11px; }
  .site-social { gap: 6px; }
  .site-social a { width: 36px; height: 36px; }
  
  /* ---------- FOOTER MOBIL: aplicatia pe un rand, social pe urmatorul ---------- */
    .site-footer {
      flex-direction: column;
      align-items: center;
      gap: 14px;
    }
  
    .site-app {
      width: 100%;
      justify-content: center;
      gap: 12px;
    }
    .site-app__icon { width: 72px; height: 72px; }
    .site-app__text { font-size: 13px; }
  
    .site-social {
      justify-content: center;
      gap: 14px;
    }
    .site-social a { width: 52px; height: 52px; }

}


/* =========================================================
   START FRAME: iconite pasi + personaje
   ========================================================= */

/* pasii: 3 iconite deasupra butonului START */
.intro-steps {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(12px, 3vw, 36px);
  margin: 10px auto 22px;
}
.intro-steps img {
  display: block;
  width: clamp(80px, 25vw, 130px);
  height: auto;
  image-rendering: pixelated;
}

/* personajele stau pe iarba, in spatele continutului */
.intro-screen {
  position: relative;
  overflow: hidden;
}
.intro-figure {
  position: absolute;
  bottom: 9.5%;
  height: clamp(110px, 24vh, 200px);
  width: auto;
  max-width: none;
  z-index: 1;
  pointer-events: none;
  image-rendering: pixelated;
}
.intro-figure--student { left: 20%; }
.intro-figure--mascot  { right: 20%; }

/* continutul (logo, text, START) peste personaje */
.intro-screen .popup-bg.intro { z-index: 2; }

@media (max-width: 900px) {
  .intro-figure--student { left: 7%; }
  .intro-figure--mascot  { right: 7%; }
}
@media (max-width: 600px) {
  .intro-figure { height: clamp(80px, 15vh, 150px); }
  .intro-figure--student { left: 13%; }
  .intro-figure--mascot  { right: 13%; }
}