* { box-sizing: border-box; }

:root {
  --ink: #343a40;
  --soft: #868e96;
  --violet: #7048e8;
  --pink: #e64980;
  --sun: #fcc419;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Baloo 2', 'Comic Sans MS', system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, #fff0f6 0, transparent 40%),
    radial-gradient(circle at 85% 20%, #e5dbff 0, transparent 45%),
    linear-gradient(180deg, #e7f5ff, #fff9db);
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* ---------- Nagłówek ---------- */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 18px max(16px, 4vw) 6px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon { font-size: 46px; animation: bob 3s ease-in-out infinite; }
.logo h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1;
  color: var(--violet);
  text-shadow: 0 4px 0 #fff, 0 6px 12px rgba(112, 72, 232, .25);
}
.tagline { flex-basis: 100%; order: 3; margin: 0; color: var(--soft); font-size: 18px; font-weight: 700; }
.tools { display: flex; gap: 10px; }
.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .1);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  color: var(--violet);
  text-decoration: none;
  cursor: pointer;
}
.tool.off { opacity: .5; }
.tool:hover { transform: translateY(-2px); }

/* ---------- Lista gier ---------- */
main { flex: 1; padding: 6px max(16px, 4vw) 24px; }
.pick { margin: 6px 0 14px; font-size: 26px; color: var(--pink); }
.games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 22px;
}
.card {
  display: flex;
  flex-direction: column;
  border: 5px solid #fff;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 8px 0 rgba(0, 0, 0, .08), 0 14px 30px rgba(112, 72, 232, .15);
  text-decoration: none;
  color: var(--ink);
  transition: transform .2s, box-shadow .2s;
}
a.card:hover, a.card:focus-visible {
  transform: translateY(-6px) rotate(-.5deg);
  box-shadow: 0 12px 0 rgba(0, 0, 0, .08), 0 20px 40px rgba(112, 72, 232, .25);
  outline: none;
}
.card:first-child { grid-column: span 2; }
@media (max-width: 700px) { .card:first-child { grid-column: auto; } }

.pic { aspect-ratio: 16 / 9; display: grid; place-items: center; background: rgba(255, 255, 255, .4); }
.pic canvas { width: 100%; height: 100%; display: block; }
.pic-icon { font-size: 64px; filter: grayscale(.2); }

.body { padding: 12px 18px 18px; }
.body h3 { margin: 0; font-size: 26px; line-height: 1.15; color: var(--violet); }
.body p { margin: 6px 0 10px; font-size: 17px; font-weight: 600; line-height: 1.35; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.meta span {
  padding: 1px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  font-size: 14px;
  font-weight: 700;
  color: var(--soft);
}
.play-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.play {
  padding: 4px 26px;
  border-radius: 999px;
  background: var(--sun);
  box-shadow: 0 5px 0 #f08c00;
  font-size: 24px;
  font-weight: 800;
  color: #5c3d00;
}
.progress { font-size: 16px; font-weight: 800; color: #e67700; }

.card.soon { opacity: .75; }
.card.soon .body h3 { color: var(--soft); }
.badge-soon {
  display: inline-block;
  padding: 2px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .85);
  font-weight: 800;
  color: var(--soft);
}

/* ---------- Stopka ---------- */
.bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--soft);
}

@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Strona dla rodziców ---------- */
.page { max-width: 860px; margin: 0 auto; padding: 8px 16px 32px; }
.page section {
  margin: 0 0 18px;
  padding: 16px 22px;
  border: 4px solid #fff;
  border-radius: 24px;
  background: rgba(255, 255, 255, .85);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .06);
}
.page h2 { margin: 0 0 6px; font-size: 24px; color: var(--violet); }
.page p, .page li { font-size: 17px; line-height: 1.5; font-weight: 500; }
.page ul { padding-left: 22px; margin: 6px 0; }
.page li { margin: 3px 0; }
.page b { color: var(--pink); }
.danger {
  padding: 8px 20px;
  border: 0;
  border-radius: 999px;
  background: #ffc9c9;
  font: inherit;
  font-weight: 800;
  color: #c92a2a;
  cursor: pointer;
}
.done { margin-left: 10px; font-weight: 800; color: #2b8a3e; }
.time-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin: 8px 0; }
.time-form label { display: flex; flex-direction: column; font-weight: 800; color: var(--violet); }
.time-form select {
  margin-top: 4px;
  padding: 4px 10px;
  border: 3px solid #d0bfff;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 18px;
}
.save {
  padding: 6px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--sun);
  box-shadow: 0 4px 0 #f08c00;
  font: inherit;
  font-weight: 800;
  color: #5c3d00;
  cursor: pointer;
}
.time-status { font-weight: 800 !important; color: #e67700; }
.hint { color: var(--soft); font-size: 15px !important; }

/* ---------- Monetki i Skarbiec ---------- */
.skarb-pill { color: #e67700; text-decoration: none; }
.skarb-pill.big { font-size: 22px; background: #fff9db; border-color: #ffe066; }
.card.locked .pic { filter: grayscale(.6) brightness(.95); }
.card.locked .play { background: #e9ecef; box-shadow: 0 5px 0 #ced4da; color: #495057; }

.shop { max-width: 1100px; width: 100%; margin: 0 auto; }
.shop-how {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 18px; padding: 10px 18px;
  border: 4px solid #fff; border-radius: 22px; background: rgba(255, 255, 255, .85);
}
.shop-how-icon { font-size: 36px; }
.shop-how p { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.4; }
.shop-how b { color: var(--pink); }
.shop-note { margin: -8px 0 12px; font-weight: 700; color: var(--soft); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-bottom: 26px; }
.sh-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border: 4px solid #fff; border-radius: 22px;
  background: rgba(255, 255, 255, .85); box-shadow: 0 6px 0 rgba(0, 0, 0, .06);
}
.sh-card.own { background: #ebfbee; border-color: #b2f2bb; }
.sh-icon { flex: none; width: 70px; height: 70px; display: grid; place-items: center; border-radius: 18px; background: #fff3bf; font-size: 42px; }
.sh-body h3 { margin: 0; font-size: 21px; line-height: 1.15; color: var(--violet); }
.sh-body p { margin: 4px 0 10px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.buy {
  display: inline-block; padding: 3px 18px; border: 0; border-radius: 999px;
  background: var(--sun); box-shadow: 0 4px 0 #f08c00;
  font: inherit; font-size: 18px; font-weight: 800; color: #5c3d00; cursor: pointer;
}
.buy.sure { background: #69db7c; box-shadow: 0 4px 0 #2f9e44; color: #fff; animation: bob 1s ease-in-out infinite; }
.buy.owned { background: #d3f9d8; box-shadow: none; color: #2b8a3e; cursor: default; }
.buy.poor, .buy.locked { background: #f1f3f5; box-shadow: none; color: var(--soft); font-size: 15px; cursor: default; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-bottom: 20px; }
.sticker {
  display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1;
  border: 4px dashed #d0bfff; border-radius: 22px; background: rgba(255, 255, 255, .6);
  font: inherit; font-size: 44px; color: #adb5bd; cursor: pointer;
}
.sticker small { font-size: 15px; font-weight: 800; color: var(--soft); }
.sticker.own { border: 4px solid #fff; background: #fff; color: inherit; font-size: 58px; box-shadow: 0 6px 0 rgba(0, 0, 0, .06); transform: rotate(-3deg); }
.sticker.own:nth-child(even) { transform: rotate(3deg); }
.sticker:disabled { opacity: .55; cursor: default; }
.sticker.sure { border-color: #40c057; background: #ebfbee; }
.sh-pop {
  position: fixed; left: 50%; top: 45%; z-index: 99; font-size: 140px; pointer-events: none;
  animation: shpop 1.6s ease-out forwards;
}
@keyframes shpop {
  0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  70% { transform: translate(-50%, -60%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -120%) scale(.6); opacity: 0; }
}

/* ---------- Konta dzieci ---------- */
.tool.konto { background: #fff0f6; border-color: #fcc2d7; color: var(--pink); }
.hello { margin: 0 0 4px; font-size: 26px; font-weight: 800; color: var(--violet); }
.hello:empty { display: none; }
.k-modal.hidden { display: none; }
.k-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(30, 20, 50, .45); }
.k-card { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px 22px; border-radius: 26px; background: #fff; text-align: center; }
.k-card h2 { margin: 0 0 10px; font-size: 30px; color: var(--violet); }
.k-card h3 { margin: 14px 0 0; font-size: 20px; color: var(--pink); }
.k-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 999px; background: #ffe3e3; font-size: 18px; cursor: pointer; }
.k-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.k-acc { position: relative; }
.k-pick {
  display: flex; flex-direction: column; align-items: center; min-width: 110px; padding: 8px 14px;
  border: 4px solid #e9ecef; border-radius: 22px; background: #fff;
  font: inherit; font-size: 20px; font-weight: 800; color: var(--ink); cursor: pointer;
}
.k-acc.on .k-pick { border-color: var(--pink); background: #fff0f6; }
.k-av { font-size: 46px; line-height: 1.1; }
.k-del { position: absolute; top: -6px; right: -6px; width: 30px; height: 30px; border: 0; border-radius: 999px; background: #f1f3f5; font-size: 14px; cursor: pointer; opacity: .6; }
.k-del:hover { opacity: 1; }
.k-hint { margin: 6px 0 8px; font-weight: 700; color: var(--soft); }
.k-new { display: flex; gap: 8px; justify-content: center; }
.k-name { flex: 1; max-width: 300px; padding: 6px 14px; border: 4px solid #d0bfff; border-radius: 18px; font: inherit; font-size: 24px; font-weight: 700; }
.k-name.bad { border-color: #ff8787; animation: kshake .4s; }
.k-ok { padding: 4px 18px; border: 0; border-radius: 18px; background: var(--sun); box-shadow: 0 4px 0 #f08c00; font: inherit; font-size: 20px; font-weight: 800; color: #5c3d00; cursor: pointer; }
.k-avatars { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px 0 4px; }
.k-avatar { width: 52px; height: 52px; border: 3px solid #e9ecef; border-radius: 16px; background: #fff; font-size: 30px; cursor: pointer; }
.k-avatar.on { border-color: var(--violet); background: #f3f0ff; transform: scale(1.1); }
.k-later { margin-top: 10px; border: 0; background: none; font: inherit; font-size: 17px; font-weight: 700; color: var(--soft); text-decoration: underline; cursor: pointer; }
@keyframes kshake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
