* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f0f6ff;
  --card: #ffffff;
  --ink: #2c3550;
  --primary: #4c6ef5;
  --good: #2f9e44;
  --bad: #e8590c;
  --locked: #aab2c8;
}

body {
  font-family: "Comic Sans MS", "Chalkboard SE", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

#app {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.top h1 { font-size: 1.6rem; }
.top.slim { margin-bottom: 8px; }
.stats { display: flex; gap: 12px; font-size: 1.2rem; font-weight: bold; }

.banner {
  background: #fff3bf;
  border: 2px solid #f59f00;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.path { list-style: none; margin-bottom: 20px; }
.path .level {
  background: var(--card);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(44, 53, 80, .08);
}
.path .level.current { border: 3px solid var(--primary); font-weight: bold; }
.path .level.locked { color: var(--locked); background: #eef1f8; }
.path .level.done { background: #e6fcf5; }
.path .icon { font-size: 1.3rem; }

button {
  font-family: inherit;
  color: var(--ink);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  touch-action: manipulation; /* bez opóźnienia i zoomu przy szybkim stukaniu */
  -webkit-tap-highlight-color: transparent;
}

.big {
  font-size: 1.6rem;
  font-weight: bold;
  padding: 18px 28px;
  min-height: 64px;
  width: 100%;
  margin-top: 8px;
}
.primary { background: var(--primary); color: #fff; box-shadow: 0 4px 0 #3b5bdb; }
.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #3b5bdb; }

.quiet {
  background: transparent;
  font-size: 1.4rem;
  padding: 6px 10px;
  color: var(--locked);
}

.parent-link { text-align: center; margin-top: 18px; }
.parent-link a { color: var(--locked); font-size: .95rem; }

.progress { font-size: 1rem; letter-spacing: 3px; color: var(--primary); }
.progress .retries { color: var(--bad); letter-spacing: 0; }

.prompt {
  font-size: 3.2rem;
  font-weight: bold;
  text-align: center;
  margin: 24px 0;
  min-height: 4rem;
}
.prompt .again { display: block; font-size: 1.1rem; color: var(--bad); }
.prompt.retry { color: #5f3dc4; }

.answer-box {
  font-size: 3rem;
  font-weight: bold;
  text-align: center;
  background: var(--card);
  border: 3px dashed var(--primary);
  border-radius: 16px;
  min-height: 76px;
  line-height: 70px;
  margin-bottom: 14px;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.key {
  font-size: 2rem;
  font-weight: bold;
  min-height: 68px;
  background: var(--card);
  box-shadow: 0 3px 0 #d0d7e8;
}
.key:active { transform: translateY(2px); box-shadow: 0 1px 0 #d0d7e8; }
.key.ok { background: var(--good); color: #fff; box-shadow: 0 3px 0 #237032; }
.key.del { background: #ffe3e3; }

.tf { display: flex; gap: 14px; margin-top: 20px; }
.tf .yes { background: var(--good); color: #fff; box-shadow: 0 4px 0 #237032; }
.tf .no { background: var(--bad); color: #fff; box-shadow: 0 4px 0 #b8470a; }

#feedback .good {
  text-align: center;
  font-size: 2rem;
  color: var(--good);
  font-weight: bold;
  margin-top: 16px;
  animation: pop .3s ease-out;
}
@keyframes pop {
  from { transform: scale(.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.hint-screen { text-align: center; }
.hint-screen .oops { font-size: 1.3rem; color: var(--bad); font-weight: bold; margin: 10px 0; }
.hint-screen .solution { font-size: 2.2rem; margin: 12px 0; }
.hint-screen .note { color: var(--primary); margin: 10px 0; }
.visual { margin: 12px auto; }
.visual svg { display: block; margin: 0 auto; }

.results { text-align: center; margin-top: 40px; }
.results h2 { font-size: 2.4rem; margin-bottom: 12px; }
.stars-row { font-size: 4rem; margin: 16px 0; animation: pop .5s ease-out; }
.results p { font-size: 1.3rem; margin-bottom: 10px; }
.badge-new {
  background: #fff3bf;
  border-radius: 14px;
  padding: 12px;
  font-size: 1.3rem;
  font-weight: bold;
  margin: 10px 0;
  animation: pop .5s ease-out;
}

/* memo (pary) */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.card {
  min-height: 76px;
  font-size: 1.3rem;
  font-weight: bold;
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
}
.card.open { background: var(--card); color: var(--ink); border: 3px solid var(--primary); }
.card.matched { background: #e6fcf5; color: var(--good); border: 3px solid var(--good); visibility: visible; }

/* panel rodzica */
.heatmap { border-collapse: collapse; margin: 12px auto; }
.heatmap td, .heatmap th {
  width: 34px; height: 34px; text-align: center;
  border: 1px solid #ccd; font-size: .85rem;
}
.heatmap .b0 { background: #eef1f8; color: var(--locked); }
.heatmap .b1 { background: #ffc9c9; }
.heatmap .b2, .heatmap .b3 { background: #ffec99; }
.heatmap .b4, .heatmap .b5 { background: #b2f2bb; }
.parent-section { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.parent-section h3 { margin-bottom: 8px; }
.parent-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.parent-actions button, .parent-actions a {
  flex: 1; font-size: 1rem; padding: 10px; border-radius: 10px;
  background: var(--primary); color: #fff; text-align: center; text-decoration: none;
}
.parent-actions .danger { background: var(--bad); }
.levels-progress { list-style: none; }
.levels-progress li { padding: 4px 0; font-size: 1rem; }
