/* gra Mystery Pixel */
.strona-gry { min-height: 100vh; background: radial-gradient(circle at 20% 0, #FFEBD0 0, var(--krem) 40%); }
.gnav { display: flex; align-items: center; gap: 14px; padding: 12px max(16px, env(safe-area-inset-left)); max-width: 1160px; margin: 0 auto; }
.wroc { width: 42px; height: 42px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-decoration: none; font-size: 30px; line-height: 1; color: var(--granat); box-shadow: 0 4px 12px rgba(0, 0, 0, .08); flex: none; }
.gnav .logo img { height: 34px; }
.gtyt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.gtyt b { font-family: Fredoka; font-size: 19px; color: var(--granat); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gtyt span { font-size: 13px; color: var(--szary); font-weight: 700; }
.levele { display: flex; gap: 6px; }
.levele button { width: 40px; height: 40px; border-radius: 12px; border: 0; font-family: Fredoka; font-weight: 700; font-size: 17px; cursor: pointer; background: #fff; color: var(--granat); box-shadow: 0 3px 0 #E6DCCB; }
.levele button.akt { background: var(--fiolet); color: #fff; box-shadow: 0 3px 0 #4D2FD6; }
.levele button.zam { color: #B8B4CC; }
.levele button.gotowy { background: var(--zielony); color: #fff; box-shadow: 0 3px 0 #1F7A35; }
@media (max-width: 640px) {
  .gnav .logo { display: none; } .gnav { gap: 10px; }
  .levele button { width: 34px; height: 34px; font-size: 15px; }
  .levele button:not(.akt) { display: none; }            /* na telefonie tylko biezacy level (reszta = Premium) */
  .gnav .jezyk button { padding: 5px 8px; font-size: 12px; }
}

.plansza { max-width: 1060px; margin: 6px auto 30px; padding: 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
@media (max-width: 860px) { .plansza { grid-template-columns: 1fr; gap: 14px; } }
.obraz-box { background: #fff; border-radius: 26px; padding: 16px; box-shadow: var(--cien); }
#obraz { width: 100%; aspect-ratio: 1; display: block; border-radius: 14px; image-rendering: pixelated; background: #EFEAF7; }
@media (max-width: 860px) { .obraz-box { padding: 10px; } #obraz { width: min(100%, 44vh); margin: 0 auto; } }
.postep { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.postep .pasek { flex: 1; height: 14px; background: #EFEAF7; border-radius: 999px; overflow: hidden; }
.postep .pasek i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--zielony), #5BCB6E); border-radius: 999px; transition: width .5s; }
.postep b { font-family: Fredoka; color: var(--granat); font-size: 18px; min-width: 64px; text-align: right; }

.zadanie-box { display: flex; flex-direction: column; gap: 16px; }
.maskotka-rzad { display: flex; align-items: flex-end; gap: 10px; min-height: 96px; }
.maskotka-rzad img { width: 92px; flex: none; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .15)); transition: transform .25s; }
.maskotka-rzad img.skok { transform: translateY(-10px) rotate(-6deg) scale(1.06); }
.dymek { background: #fff; border-radius: 20px 20px 20px 6px; padding: 12px 16px; font-weight: 700; color: var(--granat); box-shadow: 0 6px 16px rgba(0, 0, 0, .07); font-size: 17px; margin-bottom: 26px; }
.zadanie { background: #fff; border-radius: 26px; box-shadow: var(--cien); padding: 22px; display: flex; justify-content: center; align-items: center; gap: 14px;
  font-family: Fredoka; font-weight: 700; font-size: clamp(40px, 9vw, 60px); color: var(--granat); }
.zadanie .rowna { color: var(--szary); }
.zadanie .odp { min-width: 2.4em; text-align: center; border-bottom: 5px solid var(--fiolet2); color: var(--fiolet); min-height: 1.15em; }
.zadanie.dobrze { background: #E3F8E8; } .zadanie.dobrze .odp { color: var(--zielony); border-color: var(--zielony); }
.zadanie.zle { animation: trzes .4s; background: #FFE7E7; } .zadanie.zle .odp { color: var(--czerw); border-color: var(--czerw); }
@keyframes trzes { 20%, 60% { transform: translateX(-10px) } 40%, 80% { transform: translateX(10px) } }
.klawiatura { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.klawiatura button { height: 64px; border: 0; border-radius: 18px; background: #fff; font-family: Fredoka; font-weight: 700; font-size: 28px; color: var(--granat);
  box-shadow: 0 5px 0 #E6DCCB; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.klawiatura button:active { transform: translateY(3px); box-shadow: 0 2px 0 #E6DCCB; }
.klawiatura .ok { background: var(--zielony); color: #fff; box-shadow: 0 5px 0 #1F7A35; }
.klawiatura .kas { background: #F3EFE6; }
@media (max-width: 860px) {
  .zadanie-box { gap: 10px; }
  .klawiatura { gap: 8px; } .klawiatura button { height: 52px; font-size: 26px; border-radius: 15px; }
  .maskotka-rzad { min-height: 0; } .maskotka-rzad img { width: 54px; } .dymek { font-size: 15px; margin-bottom: 10px; padding: 9px 13px; }
  .zadanie { padding: 8px; font-size: 40px; border-radius: 20px; }
  .obraz-box { border-radius: 20px; } #obraz { width: min(100%, 31vh); }
  .gtyt span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .postep { margin-top: 8px; } .gnav { padding-top: 8px; padding-bottom: 4px; }
}
@media (max-width: 860px) and (max-height: 780px) {   /* mniejsze telefony */
  #obraz { width: min(100%, 27vh); } .klawiatura button { height: 46px; } .zadanie { font-size: 34px; padding: 6px; }
  .maskotka-rzad img { width: 46px; } .dymek { font-size: 14px; padding: 7px 11px; } .plansza { gap: 10px; }
}

/* okna */
.okno { position: fixed; inset: 0; background: rgba(36, 36, 79, .55); display: grid; place-items: center; z-index: 100; padding: 16px; }
.okno[hidden] { display: none; }
.okno-karta { background: #fff; border-radius: 32px; padding: 30px 26px 24px; max-width: 460px; width: 100%; text-align: center; position: relative; overflow: hidden; animation: wejscie .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes wejscie { from { transform: scale(.7); opacity: 0 } }
.okno-karta h2 { font-size: 34px; color: var(--fiolet); margin: 6px 0; }
.okno-karta p { margin: 0 0 12px; color: var(--szary); }
.okno-masc { width: 130px; margin: -6px auto 0; position: relative; z-index: 2; }
#koniec-obraz { width: 200px; height: 200px; margin: 6px auto 16px; display: block; border-radius: 14px; image-rendering: pixelated; box-shadow: 0 10px 24px rgba(0, 0, 0, .15); }
.okno-przyc { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.okno-przyc .btn { font-size: 17px; padding: 12px 20px; }
.link-wiecej { display: inline-block; margin-top: 14px; color: var(--fiolet); font-weight: 800; }
#konfetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.zamknij { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 32px; color: var(--szary); cursor: pointer; }
.okno .zapis input { border: 2px solid #E6DCCB; }
.okno .zapis-info { color: var(--szary); }
