:root {
  --ink: #243047;
  --paper: #fff9e8;
  --wall: #aee7ff;
  --wall-dark: #7bcff2;
  --floor: #ffd99a;
  --red: #ff4d6d;
  --yellow: #ffd166;
  --green: #06d6a0;
  --blue: #4cc9f0;
  --purple: #6c63ff;
  --orange: #ff9f1c;
  --white: #ffffff;
  --cream: #fff3c7;
  --shadow: 0 18px 44px rgba(36, 48, 71, 0.18);
  --radius: 8px;
  --max: 1180px;
  font-family: "Trebuchet MS", "Segoe UI", ui-rounded, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.24) 1px, transparent 1px),
    linear-gradient(var(--wall), var(--wall-dark) 56%, var(--floor) 56%);
  background-size: 34px 34px, auto;
  letter-spacing: 0;
  overflow-x: hidden;
}

img,
canvas,
svg,
video {
  max-width: 100%;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.kid-nav {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 40;
  width: min(calc(100% - 24px), var(--max));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(255, 249, 232, 0.88);
  box-shadow: 8px 8px 0 rgba(36, 48, 71, 0.18);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

.kid-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.kid-logo span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--red);
  font-weight: 900;
}

.kid-logo strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kid-nav nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.kid-nav a:not(.kid-logo) {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--white);
  text-decoration: none;
  font-weight: 800;
  box-shadow: 3px 3px 0 rgba(36, 48, 71, 0.18);
}

.playroom,
.games-zone,
.gallery-zone,
.contact-zone,
.memory-footer {
  width: min(calc(100% - 28px), var(--max));
  margin: 0 auto;
  scroll-margin-top: 108px;
}

.playroom {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.74fr) minmax(520px, 1.26fr);
  align-items: center;
  gap: clamp(26px, 4vw, 58px);
  padding: 118px 0 64px;
}

.badge {
  width: fit-content;
  margin: 0 0 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--white);
  color: var(--purple);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  display: grid;
  gap: 0.02em;
  margin: 0;
  max-width: 100%;
  font-size: clamp(48px, 4.8vw, 60px);
  line-height: 0.9;
  letter-spacing: 0;
  overflow-wrap: normal;
  text-shadow: 5px 5px 0 var(--yellow), 10px 10px 0 rgba(255, 77, 109, 0.28);
  word-break: normal;
}

h1 span {
  display: block;
  white-space: nowrap;
}

.room-copy p:not(.badge) {
  max-width: 520px;
  margin: 24px 0 0;
  font-size: clamp(19px, 2.1vw, 25px);
  line-height: 1.42;
  font-weight: 700;
}

.room-stage {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(transparent 0 59%, rgba(36, 48, 71, 0.1) 59% 60%, transparent 60%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0) 44%),
    linear-gradient(var(--wall) 0 58%, var(--floor) 58% 100%);
  box-shadow: 12px 12px 0 rgba(36, 48, 71, 0.16), var(--shadow);
}

.room-stage::before {
  content: "";
  position: absolute;
  inset: 30px 34px auto auto;
  width: 150px;
  height: 112px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--yellow) 0 24%, transparent 24%),
    linear-gradient(45deg, transparent 0 62%, var(--green) 62%),
    var(--white);
  box-shadow: 6px 6px 0 rgba(36, 48, 71, 0.15);
}

.room-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background:
    repeating-linear-gradient(90deg, transparent 0 72px, rgba(36, 48, 71, 0.08) 72px 75px),
    linear-gradient(var(--floor), #ffc36f);
  clip-path: polygon(0 24%, 100% 0, 100% 100%, 0 100%);
}

.xp-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 5;
  width: 116px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--white);
  box-shadow: 5px 5px 0 rgba(36, 48, 71, 0.18);
  text-align: center;
}

.xp-panel span {
  display: block;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.xp-panel strong {
  display: block;
  font-size: 38px;
  line-height: 1;
}

.franek-avatar {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 112px;
  width: min(44%, 270px);
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 0 rgba(36, 48, 71, 0.13));
  animation: happy-bounce 3.2s ease-in-out infinite;
}

@keyframes happy-bounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateX(-50%) translateY(-12px) rotate(1deg);
  }
}

.soft-rug {
  position: absolute;
  left: 50%;
  bottom: 60px;
  z-index: 2;
  width: 48%;
  height: 112px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background:
    repeating-radial-gradient(ellipse at center, var(--red) 0 14px, var(--yellow) 14px 28px, var(--blue) 28px 42px, var(--green) 42px 56px);
  transform: translateX(-50%) rotate(-2deg);
  opacity: 0.92;
}

.room-toy {
  position: absolute;
  z-index: 6;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}

.room-toy:hover,
.room-toy:focus-visible {
  transform: translateY(-8px) rotate(-2deg) scale(1.04);
  filter: saturate(1.2);
  outline: none;
}

.room-toy:active {
  transform: translateY(0) scale(0.98);
}

.toy-console {
  left: 7%;
  bottom: 122px;
  width: 170px;
  height: 96px;
  border: 4px solid var(--ink);
  border-radius: 28px;
  background: var(--purple);
  box-shadow: 8px 8px 0 rgba(36, 48, 71, 0.2);
}

.toy-console .screen {
  position: absolute;
  inset: 22px 54px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.toy-console .stick {
  position: absolute;
  top: 38px;
  width: 18px;
  height: 18px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
}

.toy-console .left {
  left: 24px;
}

.toy-console .right {
  right: 24px;
}

.toy-desk {
  right: 6%;
  bottom: 126px;
  width: 178px;
  height: 112px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background: #ffb56b;
  box-shadow: 8px 8px 0 rgba(36, 48, 71, 0.18);
}

.toy-desk .paper {
  position: absolute;
  left: 22px;
  top: 16px;
  width: 84px;
  height: 58px;
  border: 3px solid var(--ink);
  border-radius: 5px;
  background: var(--white);
  transform: rotate(-5deg);
}

.toy-desk .crayon {
  position: absolute;
  width: 46px;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 99px;
}

.crayon-a {
  right: 18px;
  top: 28px;
  background: var(--red);
  transform: rotate(16deg);
}

.crayon-b {
  right: 32px;
  top: 54px;
  background: var(--green);
  transform: rotate(-12deg);
}

.desk-leg {
  position: absolute;
  bottom: -42px;
  width: 18px;
  height: 44px;
  border: 3px solid var(--ink);
  background: #ce7b42;
}

.desk-leg.left {
  left: 24px;
}

.desk-leg.right {
  right: 24px;
}

.toy-chest {
  left: 9%;
  bottom: 286px;
  width: 148px;
  height: 94px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background: var(--orange);
  box-shadow: 7px 7px 0 rgba(36, 48, 71, 0.18);
}

.toy-chest .lid {
  position: absolute;
  left: -5px;
  right: -5px;
  top: -32px;
  height: 42px;
  border: 4px solid var(--ink);
  border-radius: 18px 18px 6px 6px;
  background: var(--yellow);
}

.toy-chest .lock {
  position: absolute;
  left: 50%;
  top: 30px;
  width: 28px;
  height: 28px;
  border: 3px solid var(--ink);
  border-radius: 5px;
  background: var(--white);
  transform: translateX(-50%);
}

.toy-pizza {
  right: 26%;
  bottom: 74px;
  width: 128px;
  height: 128px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 7px 7px 0 rgba(36, 48, 71, 0.18);
}

.toy-pizza span {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--red);
}

.toy-pizza span:nth-child(1) {
  left: 28px;
  top: 30px;
}

.toy-pizza span:nth-child(2) {
  right: 28px;
  top: 42px;
}

.toy-pizza span:nth-child(3) {
  left: 52px;
  bottom: 26px;
}

.toy-bike {
  left: 28%;
  bottom: 64px;
  width: 176px;
  height: 104px;
}

.toy-bike .wheel {
  position: absolute;
  bottom: 0;
  width: 58px;
  height: 58px;
  border: 7px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
}

.wheel-left {
  left: 0;
}

.wheel-right {
  right: 0;
}

.toy-bike .frame {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 28px;
  height: 44px;
  border: 7px solid var(--green);
  border-top: 0;
  transform: skewX(-18deg);
}

.toy-bike .handle {
  position: absolute;
  right: 26px;
  top: 10px;
  width: 50px;
  height: 28px;
  border-top: 7px solid var(--ink);
  border-right: 7px solid var(--ink);
}

.toy-rocket {
  right: 18%;
  top: 126px;
  width: 72px;
  height: 132px;
  border: 4px solid var(--ink);
  border-radius: 50% 50% 16px 16px;
  background: linear-gradient(90deg, var(--red) 0 24%, var(--white) 24% 76%, var(--red) 76%);
  box-shadow: 7px 7px 0 rgba(36, 48, 71, 0.14);
}

.toy-rocket::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 26px;
  width: 28px;
  height: 28px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--blue);
  transform: translateX(-50%);
}

.toy-rocket .flame {
  position: absolute;
  left: 50%;
  bottom: -42px;
  width: 34px;
  height: 48px;
  background: var(--yellow);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  transform: translateX(-50%);
}

.room-message {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  min-height: 54px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: rgba(255, 249, 232, 0.94);
  box-shadow: 5px 5px 0 rgba(36, 48, 71, 0.14);
  font-size: 17px;
  font-weight: 900;
  text-align: center;
}

.games-zone,
.gallery-zone,
.contact-zone {
  padding: 72px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-head h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.95;
  text-shadow: 4px 4px 0 rgba(255, 209, 102, 0.84);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.game-card,
.contact-box {
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 10px 10px 0 rgba(36, 48, 71, 0.16);
}

.game-card {
  min-height: 360px;
  padding: 18px;
}

.game-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  margin-bottom: 14px;
}

.game-title-row h3 {
  margin: 0;
  font-size: 26px;
}

.game-title-row span {
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--white);
  font-weight: 900;
}

.star-field {
  position: relative;
  min-height: 236px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 16% 24%, rgba(255, 255, 255, 0.7) 0 18px, transparent 19px),
    radial-gradient(circle at 76% 32%, rgba(255, 255, 255, 0.65) 0 24px, transparent 25px),
    linear-gradient(#8adfff, #c9f4ff);
}

.star-target {
  position: absolute;
  left: 44%;
  top: 36%;
  width: 56px;
  height: 56px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--yellow);
  cursor: pointer;
  clip-path: polygon(50% 0, 62% 34%, 98% 35%, 69% 55%, 80% 92%, 50% 70%, 20% 92%, 31% 55%, 2% 35%, 38% 34%);
}

.draw-game canvas {
  width: 100%;
  aspect-ratio: 680 / 420;
  display: block;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  cursor: crosshair;
  touch-action: none;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.swatches button {
  width: 38px;
  height: 38px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(36, 48, 71, 0.17);
}

.tiny-button,
.big-play-button {
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  box-shadow: 4px 4px 0 rgba(36, 48, 71, 0.18);
  transition: transform 120ms ease;
}

.tiny-button {
  min-height: 38px;
  padding: 0 12px;
}

.big-play-button {
  min-height: 48px;
  padding: 0 18px;
}

.tiny-button:hover,
.big-play-button:hover {
  transform: translateY(-3px);
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.memory-card {
  min-height: 86px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--blue);
  color: var(--ink);
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 4px 4px 0 rgba(36, 48, 71, 0.14);
}

.memory-card.is-open,
.memory-card.is-matched {
  background: var(--yellow);
}

.memory-card.is-matched {
  opacity: 0.68;
}

.bike-track {
  position: relative;
  height: 104px;
  margin: 10px 0 16px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, transparent 0 32px, rgba(36, 48, 71, 0.1) 32px 36px),
    linear-gradient(#c9f4ff 0 48%, #70d47a 48%);
  background-size: 72px 100%, auto;
}

.bike-rider {
  position: absolute;
  left: 8px;
  bottom: 20px;
  width: 70px;
  height: 42px;
  transform: translateX(var(--bike-progress, 0));
  transition: transform 160ms ease;
  background:
    linear-gradient(135deg, transparent 42%, var(--red) 43% 58%, transparent 59%),
    linear-gradient(45deg, transparent 42%, var(--green) 43% 58%, transparent 59%);
}

.bike-rider::before,
.bike-rider::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 28px;
  height: 28px;
  border: 5px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
}

.bike-rider::before {
  left: 0;
}

.bike-rider::after {
  right: 0;
}

.game-status,
.shelf-message,
.gallery-message {
  min-height: 24px;
  margin: 12px 0 0;
  font-size: 16px;
  font-weight: 800;
}

.toy-shelf {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px;
  background:
    linear-gradient(#b57244 0 16px, transparent 16px),
    linear-gradient(var(--paper), var(--paper));
  box-shadow: 10px 10px 0 rgba(36, 48, 71, 0.16);
}

.toy-shelf button {
  min-height: 100px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 5px 5px 0 rgba(36, 48, 71, 0.15);
}

.toy-shelf button:nth-child(1) {
  background: var(--purple);
  color: var(--white);
}

.toy-shelf button:nth-child(2) {
  background: var(--yellow);
}

.toy-shelf button:nth-child(3) {
  background: var(--green);
}

.toy-shelf button:nth-child(4) {
  background: var(--blue);
}

.toy-shelf button:nth-child(5) {
  background: #f8b4d9;
}

.toy-shelf button:nth-child(6) {
  background: var(--orange);
}

.gallery-lead {
  max-width: 820px;
  margin: 0 0 18px;
  font-size: 20px;
  line-height: 1.45;
  font-weight: 800;
}

.art-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.art-photo-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--paper);
  box-shadow: 8px 8px 0 rgba(36, 48, 71, 0.14);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.art-photo-card:not(.is-empty),
.art-photo-card.has-photo {
  cursor: pointer;
}

.art-photo-card:not(.is-empty):hover,
.art-photo-card:not(.is-empty):focus-visible,
.art-photo-card.has-photo:hover,
.art-photo-card.has-photo:focus-visible,
.art-photo-card.is-active {
  transform: translateY(-5px) rotate(-1deg);
  background: #fffdf4;
  box-shadow: 10px 12px 0 rgba(36, 48, 71, 0.16);
  outline: none;
}

.art-photo-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.42), rgba(76, 201, 240, 0.34)),
    repeating-linear-gradient(45deg, rgba(36, 48, 71, 0.08) 0 8px, transparent 8px 18px),
    var(--white);
}

.art-photo-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.art-photo-frame span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(36, 48, 71, 0.34);
  font-size: clamp(52px, 8vw, 86px);
  font-weight: 900;
}

.art-photo-card h3 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.05;
}

.art-photo-card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 800;
}

.gallery-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.gallery-more-link {
  min-width: 240px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.big-gallery-page {
  padding-top: 118px;
}

.big-gallery-zone {
  min-height: 72vh;
}

.big-gallery-zone h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 82px);
  line-height: 0.95;
  text-shadow: 4px 4px 0 rgba(255, 209, 102, 0.84);
}

.art-gallery-large {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gallery-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.gallery-pagination .pill.active {
  background: var(--yellow);
}

.empty-gallery-note {
  display: grid;
  justify-items: start;
  gap: 12px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--paper);
  box-shadow: 8px 8px 0 rgba(36, 48, 71, 0.14);
}

.empty-gallery-note h2,
.empty-gallery-note p {
  margin: 0;
}

.empty-gallery-note h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.empty-gallery-note p {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 800;
}

html.has-artwork-lightbox,
body.has-artwork-lightbox {
  overflow: hidden;
  max-width: 100%;
}

.artwork-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  width: 100%;
  max-width: 100%;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(36, 48, 71, 0.72);
  backdrop-filter: blur(8px);
}

.artwork-lightbox.is-open {
  display: grid;
}

.artwork-lightbox-card {
  width: min(980px, 100%);
  max-height: min(86vh, 820px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 14px 14px 0 rgba(0, 0, 0, 0.22);
}

.artwork-lightbox-card img {
  width: 100%;
  max-height: 66vh;
  display: block;
  object-fit: contain;
  background:
    linear-gradient(90deg, rgba(36, 48, 71, 0.06) 1px, transparent 1px),
    linear-gradient(var(--white), #f3fbff);
  background-size: 26px 26px, auto;
}

.artwork-lightbox-card div {
  padding: 16px 18px 18px;
  border-top: 4px solid var(--ink);
}

.artwork-lightbox-card h3 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.artwork-lightbox-card p {
  margin: 8px 0 0;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 800;
}

.artwork-lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1;
  width: 52px;
  height: 52px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  cursor: pointer;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.22);
}

.sticker-lab {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72) 0 28%, transparent 28%),
    linear-gradient(135deg, #d7fff1, #fff3c7);
  box-shadow: 8px 8px 0 rgba(36, 48, 71, 0.13);
}

.sticker-lab h3,
.art-card h3,
.status-form h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.sticker-lab p,
.art-card p,
.status-form p {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
}

.art-wall {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.art-card {
  display: grid;
  gap: 12px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--paper);
  cursor: pointer;
  box-shadow: 8px 8px 0 rgba(36, 48, 71, 0.14);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.art-card:hover,
.art-card:focus-visible,
.art-card.is-active {
  transform: translateY(-5px) rotate(-1deg);
  background: #fffdf4;
  box-shadow: 10px 12px 0 rgba(36, 48, 71, 0.16);
  outline: none;
}

.mini-art {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--blue);
}

.mini-art span {
  position: absolute;
  display: block;
}

.mini-art-bike {
  background:
    radial-gradient(circle at 74% 18%, #fff 0 16px, transparent 17px),
    linear-gradient(#26345f 0 54%, #56d68f 54%);
}

.mini-art-bike span:nth-child(1),
.mini-art-bike span:nth-child(2) {
  bottom: 16px;
  width: 44px;
  height: 44px;
  border: 7px solid var(--yellow);
  border-radius: 50%;
  background: var(--ink);
}

.mini-art-bike span:nth-child(1) {
  left: 18px;
}

.mini-art-bike span:nth-child(2) {
  right: 18px;
}

.mini-art-bike span:nth-child(3) {
  left: 48px;
  right: 48px;
  bottom: 39px;
  height: 8px;
  background: var(--red);
  transform: rotate(-13deg);
}

.mini-art-pizza {
  background: radial-gradient(circle at 50% 50%, #ffe083 0 34%, #ff9f1c 35% 52%, #4cc9f0 53%);
}

.mini-art-pizza span {
  width: 20px;
  height: 20px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--red);
}

.mini-art-pizza span:nth-child(1) {
  left: 34%;
  top: 32%;
}

.mini-art-pizza span:nth-child(2) {
  right: 31%;
  top: 46%;
}

.mini-art-pizza span:nth-child(3) {
  left: 47%;
  bottom: 24%;
  background: var(--green);
}

.mini-art-forest {
  background: linear-gradient(#b7f3ff 0 48%, #b4ec86 48%);
}

.mini-art-forest span {
  bottom: 18px;
  width: 42px;
  height: 86px;
  border: 3px solid var(--ink);
  border-radius: 26px 26px 8px 8px;
  background: var(--green);
}

.mini-art-forest span:nth-child(1) {
  left: 16px;
}

.mini-art-forest span:nth-child(2) {
  left: 50%;
  height: 104px;
  transform: translateX(-50%);
  background: #63d471;
}

.mini-art-forest span:nth-child(3) {
  right: 16px;
  background: #18b884;
}

.mini-art-rocket {
  background:
    radial-gradient(circle at 25% 22%, #fff 0 7px, transparent 8px),
    radial-gradient(circle at 72% 30%, #fff 0 5px, transparent 6px),
    linear-gradient(#17345e 0 62%, #4cc9f0 62%);
}

.mini-art-rocket span:nth-child(1) {
  left: 50%;
  top: 22px;
  width: 42px;
  height: 82px;
  border: 4px solid var(--ink);
  border-radius: 50% 50% 12px 12px;
  background: var(--white);
  transform: translateX(-50%);
}

.mini-art-rocket span:nth-child(2) {
  left: 50%;
  bottom: 18px;
  width: 24px;
  height: 34px;
  background: var(--orange);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  transform: translateX(-50%);
}

.mini-art-rocket span:nth-child(3) {
  left: 50%;
  top: 48px;
  width: 20px;
  height: 20px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--blue);
  transform: translateX(-50%);
}

.contact-box {
  width: 100%;
  max-width: none;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 18px 22px;
  align-items: start;
}

.contact-intro {
  grid-column: 1 / -1;
  margin: 0 0 18px;
  font-size: 20px;
  line-height: 1.45;
  font-weight: 800;
}

.mail-form {
  grid-column: 1;
  display: grid;
  gap: 16px;
}

.mail-machine {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  min-height: 280px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(36, 48, 71, 0.1) 0 4px, transparent 4px 100%),
    linear-gradient(#72ddf7, #ffd166);
  background-size: 24px 100%, auto;
  box-shadow: 8px 8px 0 rgba(36, 48, 71, 0.14);
  overflow: hidden;
}

.mail-machine::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 34px;
  height: 78px;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: inset 0 -16px 0 rgba(255, 209, 102, 0.5);
}

.mail-machine-light {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 26px;
  height: 26px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(6, 214, 160, 0.18);
}

.mail-slot {
  position: absolute;
  left: 36px;
  right: 36px;
  top: 142px;
  height: 36px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
}

.mail-slot span {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 11px;
  height: 8px;
  border-radius: 999px;
  background: var(--ink);
}

.mail-capsule {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 96px;
  height: 46px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red) 0 50%, var(--yellow) 50%);
  transform: translateX(-50%);
  box-shadow: 5px 5px 0 rgba(36, 48, 71, 0.16);
}

.mail-capsule span {
  position: absolute;
  left: 50%;
  top: -4px;
  bottom: -4px;
  width: 4px;
  background: var(--ink);
}

.mail-dial {
  position: absolute;
  left: 28px;
  bottom: 30px;
  width: 42px;
  height: 42px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
}

.contact-box.is-sealed .mail-capsule {
  animation: capsule-seal 720ms cubic-bezier(.18, 1.2, .32, 1);
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-switch label {
  display: block;
}

.mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-switch span {
  min-height: 50px;
  display: grid;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 4px 4px 0 rgba(36, 48, 71, 0.18);
  cursor: pointer;
  font-weight: 900;
  text-align: center;
}

.mode-switch input:checked + span {
  background: var(--yellow);
  color: var(--ink);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mail-form label,
.status-form label {
  display: grid;
  gap: 8px;
  font-size: 16px;
  font-weight: 900;
}

.mail-form input,
.mail-form textarea,
.status-form input {
  width: 100%;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--white);
  color: var(--ink);
  font: 800 16px/1.4 "Trebuchet MS", "Segoe UI", ui-rounded, system-ui, sans-serif;
  box-shadow: 4px 4px 0 rgba(36, 48, 71, 0.12);
}

.mail-form textarea {
  resize: vertical;
  min-height: 160px;
}

.capsule-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  border: 3px dashed var(--purple);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(108, 99, 255, 0.08);
}

.capsule-fields[hidden],
.capsule-ticket[hidden] {
  display: none;
}

/* Honeypot: poza ekranem, ale technicznie widoczny i wypełnialny dla botów.
   Selektor .mail-form .honey-field ma wyższą specyficzność (0,2,0) niż
   .mail-form label (0,1,1) — bez tego display:grid z label by nadpisywało. */
.mail-form .honey-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.quick-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-note,
.form-status,
.status-result {
  margin: 0 !important;
  font-size: 16px !important;
}

.form-note {
  color: #4d5870;
}

.form-status {
  min-height: 24px;
  color: var(--purple);
}

.status-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px) auto;
  gap: 14px;
  align-items: end;
  border: 4px dashed var(--ink);
  border-radius: var(--radius);
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(108, 99, 255, 0.13), rgba(76, 201, 240, 0.18)),
    var(--white);
}

.status-form .tiny-button {
  min-height: 52px;
  padding-inline: 18px;
}

.status-result {
  grid-column: 1 / -1;
  min-height: 24px;
  color: var(--purple);
  font-weight: 900;
}

.status-result.is-ok {
  color: #087f5b;
}

.status-result.is-error {
  color: var(--red);
}

.capsule-ticket {
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--blue);
  box-shadow: 6px 6px 0 rgba(36, 48, 71, 0.16);
}

.capsule-ticket span {
  display: block;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.capsule-ticket strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(26px, 4vw, 42px);
}

.capsule-ticket p {
  margin: 8px 0 0 !important;
  font-size: 16px !important;
}

.memory-footer {
  padding: 24px 0 54px;
}

.footer-capsule {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.8), rgba(255, 249, 232, 0.94) 42%, rgba(76, 201, 240, 0.45)),
    var(--paper);
  box-shadow: 10px 10px 0 rgba(36, 48, 71, 0.15);
}

.footer-mark {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 6px 6px 0 var(--red);
}

.footer-mark span {
  font-size: 42px;
  font-weight: 900;
}

.footer-capsule h2 {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1;
  text-shadow: 3px 3px 0 rgba(255, 209, 102, 0.72);
}

.footer-capsule p:not(.badge) {
  max-width: 780px;
  margin: 10px 0 0;
  font-size: 19px;
  line-height: 1.45;
  font-weight: 800;
}

.footer-sparks {
  position: relative;
  width: 108px;
  height: 92px;
}

.footer-sparks span {
  position: absolute;
  display: block;
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(36, 48, 71, 0.14);
}

.footer-sparks span:nth-child(1) {
  top: 8px;
  right: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--green);
}

.footer-sparks span:nth-child(2) {
  left: 4px;
  top: 34px;
  width: 58px;
  height: 34px;
  border-radius: 999px;
  background: var(--blue);
}

.footer-sparks span:nth-child(3) {
  right: 26px;
  bottom: 2px;
  width: 34px;
  height: 34px;
  background: var(--red);
  transform: rotate(12deg);
}

@keyframes capsule-seal {
  0% {
    transform: translateX(-50%) translateY(0) rotate(0);
  }
  45% {
    transform: translateX(-50%) translateY(-86px) rotate(8deg);
  }
  100% {
    transform: translateX(-50%) translateY(0) rotate(0);
  }
}

.pop {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--white);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 5px 5px 0 rgba(36, 48, 71, 0.15);
  animation: pop-away 900ms ease-out forwards;
}

@keyframes pop-away {
  to {
    transform: translateY(-86px) rotate(8deg) scale(1.18);
    opacity: 0;
  }
}

.rocket-mode .toy-rocket {
  animation: rocket-wiggle 460ms ease-in-out infinite;
}

@keyframes rocket-wiggle {
  50% {
    transform: translateY(-14px) rotate(4deg);
  }
}

@media (max-width: 980px) {
  .playroom {
    grid-template-columns: 1fr;
    padding-top: 132px;
  }

  .room-copy {
    max-width: 760px;
  }

  .room-stage {
    min-height: 590px;
  }

  .game-layout,
  .toy-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .art-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-box {
    grid-template-columns: 1fr;
  }

  .mail-machine {
    grid-column: 1;
    grid-row: auto;
    min-height: 210px;
  }

  .status-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 660px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body {
    position: relative;
  }

  main,
  section,
  .kid-nav,
  .playroom,
  .games-zone,
  .gallery-zone,
  .contact-zone,
  .quest-zone {
    max-width: 100%;
  }

  .kid-nav {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    display: grid;
    grid-template-columns: 1fr;
    width: calc(100% - 16px);
    margin: 8px auto 0;
    padding: 8px;
    gap: 8px;
    transform: none;
    box-shadow: 5px 5px 0 rgba(36, 48, 71, 0.16);
    backdrop-filter: none;
  }

  .kid-nav nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .kid-nav a:not(.kid-logo) {
    justify-content: center;
    min-height: 42px;
    padding: 0 8px;
    font-size: 16px;
  }

  .kid-logo span {
    width: 38px;
    height: 38px;
  }

  .kid-logo strong {
    font-size: 18px;
  }

  .playroom {
    width: min(calc(100% - 18px), var(--max));
    min-height: auto;
    padding-top: 28px;
    gap: 22px;
  }

  .room-copy {
    min-width: 0;
    overflow: hidden;
  }

  h1 {
    font-size: clamp(38px, 10.8vw, 44px);
    text-shadow: 4px 4px 0 var(--yellow), 7px 7px 0 rgba(255, 77, 109, 0.24);
  }

  .room-copy p:not(.badge) {
    font-size: 20px;
    line-height: 1.36;
  }

  .room-stage {
    min-height: 520px;
  }

  .room-stage::before {
    top: 86px;
    right: 22px;
    width: 128px;
    height: 96px;
  }

  .xp-panel {
    top: 14px;
    left: 14px;
    width: 96px;
    padding: 8px;
  }

  .xp-panel strong {
    font-size: 42px;
  }

  .franek-avatar {
    width: min(52%, 206px);
    bottom: 84px;
  }

  .toy-console {
    left: 4%;
    width: 132px;
    height: 78px;
  }

  .toy-desk {
    right: 4%;
    width: 134px;
    height: 92px;
  }

  .toy-chest {
    left: 5%;
    width: 120px;
  }

  .toy-bike {
    left: 20%;
    width: 148px;
  }

  .toy-pizza {
    right: 12%;
    width: 94px;
    height: 94px;
  }

  .toy-rocket {
    right: 8%;
    width: 58px;
    height: 108px;
  }

  .games-zone,
  .gallery-zone,
  .contact-zone,
  .memory-footer {
    width: min(calc(100% - 18px), var(--max));
    padding: 52px 0;
  }

  .section-head {
    display: block;
  }

  .section-head h2 {
    font-size: 36px;
    line-height: 1;
  }

  .game-layout,
  .toy-shelf {
    grid-template-columns: 1fr;
  }

  .mode-switch,
  .form-grid,
  .capsule-fields,
  .art-wall,
  .art-gallery {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .big-gallery-page {
    padding-top: 28px;
  }

  .big-gallery-zone h1 {
    font-size: 38px;
  }

  .art-photo-card {
    padding: 10px;
    min-width: 0;
    max-width: 100%;
    box-shadow: 5px 5px 0 rgba(36, 48, 71, 0.14);
  }

  .art-photo-card,
  .art-photo-frame {
    overflow: hidden;
  }

  .art-photo-card h3 {
    font-size: 24px;
  }

  .artwork-lightbox {
    align-items: start;
    justify-items: center;
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    padding: 62px 8px 12px;
    overflow: auto;
    overflow-x: hidden;
    background: rgba(36, 48, 71, 0.86);
    backdrop-filter: blur(5px);
  }

  .artwork-lightbox-card {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    min-width: 0;
    max-height: none;
    overflow: visible;
    border-width: 3px;
    box-shadow: none;
  }

  .artwork-lightbox-card img {
    max-height: calc(100svh - 230px);
    min-height: 0;
    object-fit: contain;
  }

  .artwork-lightbox-card div {
    padding: 12px 14px 14px;
  }

  .artwork-lightbox-card h3 {
    font-size: 30px;
  }

  .artwork-lightbox-card p {
    font-size: 17px;
  }

  .artwork-lightbox-close {
    top: calc(max(8px, env(safe-area-inset-top)) + 4px);
    right: max(8px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    border-width: 3px;
    font-size: 28px;
    box-shadow: none;
  }

  .sticker-lab {
    align-items: stretch;
    flex-direction: column;
  }

  .mail-machine {
    min-height: 190px;
  }

  .memory-footer {
    padding-top: 22px;
    padding-bottom: 34px;
  }

  .footer-capsule {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .footer-mark {
    width: 64px;
    height: 64px;
  }

  .footer-mark span {
    font-size: 34px;
  }

  .footer-capsule h2 {
    font-size: 32px;
  }

  .footer-capsule p:not(.badge) {
    font-size: 17px;
  }

  .footer-sparks {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================================
   ROZBUDOWA: QUEST, EKWIPUNEK, ACHIEVEMENTY, NOWE GRY, TOASTS
   ========================================================================= */

/* --- Ekwipunek w pokoju --- */
.inventory-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  font-size: 20px;
  font-weight: 900;
  box-shadow: 4px 4px 0 rgba(36, 48, 71, 0.18);
  z-index: 2;
}
.inv-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 32px;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(255, 217, 61, 0.18);
  color: var(--ink);
}
.inv-item.locked {
  background: rgba(36, 48, 71, 0.08);
  color: rgba(36, 48, 71, 0.4);
  font-size: 14px;
}
.inv-item.owned {
  animation: invPop 360ms cubic-bezier(.2,1.3,.4,1);
}
@keyframes invPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); }
}

/* --- Ewolucja pokoju z fabułą --- */
.room-stage.chest-open .toy-chest {
  background: linear-gradient(180deg, #ffd166 0%, #ffae3d 100%);
  box-shadow: 4px 4px 0 #b87300, 0 0 24px rgba(255, 209, 102, 0.6);
}
.room-stage.chest-open .toy-chest .lock {
  opacity: 0;
}
.room-stage.has-compass .toy-rocket {
  filter: drop-shadow(0 0 14px rgba(76, 201, 240, 0.7));
}
.room-stage.mission-complete::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 209, 102, 0.18), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(76, 201, 240, 0.18), transparent 40%);
  pointer-events: none;
  animation: roomShine 6s ease-in-out infinite;
}
@keyframes roomShine {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* --- Sekcja questa --- */
.quest-zone {
  width: min(calc(100% - 28px), 1120px);
  margin: 8px auto 32px;
}
.quest-banner {
  border: 4px solid var(--ink);
  border-radius: 20px;
  background: linear-gradient(135deg, #ffe9a5 0%, #ffd166 100%);
  padding: 22px 26px;
  box-shadow: 10px 10px 0 rgba(36, 48, 71, 0.14);
  display: grid;
  gap: 12px;
}
.quest-banner.quest-done {
  background: linear-gradient(135deg, #b6f0d6 0%, #4cc9f0 100%);
}
.quest-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.quest-counter {
  font-weight: 900;
  background: rgba(36, 48, 71, 0.14);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
}
.quest-banner h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}
.quest-banner p {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
}

/* --- Achievementy --- */
.achievements-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.badge-tile {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  transition: transform 200ms, background 200ms;
}
.badge-tile.earned {
  background: rgba(6, 214, 160, 0.25);
  transform: translateY(-2px);
}
.badge-tile.locked {
  opacity: 0.55;
}
.badge-tile strong {
  font-size: 15px;
}
.badge-tile span {
  font-weight: 700;
}

/* --- Lock overlay na grach --- */
.game-card {
  position: relative;
}
.game-card .lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 249, 232, 0.92);
  border-radius: var(--radius);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  z-index: 3;
  border: 4px dashed var(--ink);
}
.game-card .lock-overlay span {
  font-size: 56px;
  line-height: 1;
}
.game-card .lock-overlay p {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  max-width: 320px;
}
.game-card.locked .lock-overlay {
  display: flex;
}
.game-card.locked > *:not(.lock-overlay) {
  pointer-events: none;
}

/* --- Gra: Labirynt --- */
.maze-game canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 17 / 10;
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 rgba(36, 48, 71, 0.16);
  touch-action: none;
}
.maze-controls {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-top: 10px;
}
.maze-controls-row {
  display: flex;
  gap: 6px;
}
.maze-controls .tiny-button {
  min-width: 52px;
  font-size: 22px;
  padding: 8px 14px;
}

/* --- Gra: Rakieta --- */
.rocket-game canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 17 / 10;
  background: #0b1532;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 rgba(36, 48, 71, 0.16);
  touch-action: none;
}
.rocket-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}
.rocket-controls .tiny-button {
  min-width: 80px;
  font-size: 22px;
  padding: 10px 18px;
}

/* --- Toasts --- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: grid;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
  max-width: 340px;
}
.toast {
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 900;
  font-size: 15px;
  box-shadow: 6px 6px 0 rgba(36, 48, 71, 0.18);
  opacity: 0;
  transform: translateY(-12px) scale(0.96);
  transition: opacity 360ms ease, transform 360ms ease;
  pointer-events: auto;
}
.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toast-quest {
  background: linear-gradient(135deg, #ffd166 0%, #ff9d3f 100%);
}
.toast-achievement {
  background: linear-gradient(135deg, #4cc9f0 0%, #6c63ff 100%);
  color: var(--white);
}

/* --- Mobile --- */
@media (max-width: 720px) {
  .inventory-panel {
    top: 14px;
    right: 14px;
    left: 124px;
    justify-content: center;
    font-size: 16px;
    padding: 8px;
    overflow: hidden;
  }
  .inv-item {
    min-width: 0;
    height: 30px;
    padding: 0 8px;
    white-space: nowrap;
  }
  .quest-banner h2 {
    font-size: 22px;
  }
  .quest-banner p {
    font-size: 15px;
  }
  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}
