/* Gyerekbarát, nagy célterületű, magas kontrasztú stílus 6-7 éveseknek.
   A betűtípus rendszerfont, amely garantáltan tartalmazza a magyar
   ékezetes karaktereket (á é í ó ö ő ú ü ű). */

:root {
  --bg: #fef9f3;
  --ink: #2b2b3a;
  --primary: #ff7a59;
  --primary-dark: #e85d3d;
  --blue: #4aa3df;
  --blue-dark: #2f7fbf;
  --green: #4caf50;
  --green-dark: #388e3c;
  --yellow: #ffc94d;
  --red-soft: #ef9a9a;
  --card: #ffffff;
  --shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
  --radius: 24px;
  --target: 96px; /* minimális kattintható méret */
}

* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  /* A becsomagolt "Baloo 2" az elsődleges (minden eszközön egységes); a
     rendszerfontok csak tartalékként, ha a webfont nem töltődne be. */
  /* Elsődleges a Comic Sans MS (ahol telepítve van, pl. PC); a becsomagolt
     "Baloo 2" a tartalék, így mobilon sem esik vissza sima rendszerfontra. */
  font-family: "Comic Sans MS", "Baloo 2", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: clamp(18px, 2.5vw, 26px);
  overflow-x: hidden;
}

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

/* ---------- Fejléc (vissza, pont, hang) ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.icon-btn {
  border: none;
  background: var(--card);
  border-radius: 50%;
  width: var(--target);
  height: var(--target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s ease;
}
.icon-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,0.12); }
.icon-btn svg { width: 52px; height: 52px; }

.scoreboard {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  background: var(--card);
  padding: 10px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.scoreboard .star-count { color: var(--primary-dark); }
.scoreboard svg { width: 40px; height: 40px; }

/* ---------- Kezdőképernyő ---------- */
.menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  text-align: center;
}
.menu h1 {
  font-size: clamp(32px, 6vw, 56px);
  margin: 0;
  color: var(--primary-dark);
}
.menu .stars-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
}
.menu .stars-banner svg { width: 44px; height: 44px; }
.menu-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
}
.menu-card {
  border: none;
  cursor: pointer;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: clamp(220px, 38vw, 320px);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: transform 0.1s ease;
}
.menu-card:active { transform: translateY(4px); }
.menu-card .emoji { font-size: 96px; line-height: 1; }
.menu-card .label { font-size: clamp(26px, 4vw, 36px); font-weight: 800; }
.menu-card.math { outline: 6px solid var(--blue); }
.menu-card.letters { outline: 6px solid var(--primary); }
.menu-card.time { outline: 6px solid var(--green); }
.menu-card.colors { outline: 6px solid #8e24aa; }

/* ---------- Feladat képernyő ---------- */
.task {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.instruction {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 700;
  text-align: center;
  background: var(--card);
  padding: 14px 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: clamp(40px, 8vw, 80px);
  font-weight: 800;
  min-height: 120px;
}
/* A megszámolandó tárgyak mindig tördeljenek, függetlenül az emoji Unicode
   sortörési osztályától (a ⭐ pl. AL-osztályú és különben megszakíthatatlan
   füzért alkotna, ami keskeny kijelzőn kifutna). */
.objects { overflow-wrap: anywhere; word-break: break-word; }
.prompt .objects { font-size: clamp(36px, 7vw, 64px); letter-spacing: 4px; max-width: 720px; }
.prompt .equation { display: flex; align-items: center; gap: 16px; }

/* Kattintható válaszok */
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}
.choice {
  border: none;
  cursor: pointer;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: var(--target);
  min-height: var(--target);
  padding: 18px 26px;
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.08s ease, background 0.15s ease;
}
.choice .objects { font-size: clamp(28px, 5vw, 44px); }
.choice:active { transform: translateY(3px); }
.choice.correct { background: var(--green); color: #fff; animation: pop 0.4s ease; }
.choice.wrong { background: var(--red-soft); animation: shake 0.4s ease; }
.choice[disabled] { cursor: default; opacity: 0.6; }

/* Drag & drop */
.dnd { display: flex; flex-direction: column; gap: 28px; align-items: center; width: 100%; }
.tray {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  min-height: var(--target);
  padding: 10px;
}
.token {
  background: var(--yellow);
  border-radius: 20px;
  box-shadow: var(--shadow);
  min-width: var(--target);
  min-height: var(--target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 800;
  cursor: grab;
  touch-action: none;
  padding: 12px 18px;
}
.token.dragging { cursor: grabbing; z-index: 1000; box-shadow: 0 14px 24px rgba(0,0,0,0.25); }
.token.placed { background: var(--green); color: #fff; cursor: default; }
.zones { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; }
.drop-zone {
  background: #fff;
  border: 5px dashed var(--blue);
  border-radius: var(--radius);
  min-width: 150px;
  min-height: 150px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
.drop-zone .zone-label {
  font-size: clamp(22px, 4vw, 40px);
  font-weight: 800;
}
.drop-zone .zone-slots { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.drop-zone.hover { border-color: var(--green); background: #eafbe7; }

/* Visszajelzés és jutalom */
@keyframes pop { 0% { transform: scale(1);} 40% { transform: scale(1.25);} 100% { transform: scale(1);} }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-8px);} 75%{transform:translateX(8px);} }

.reward-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  z-index: 2000;
  animation: fadein 0.2s ease;
}
.reward-overlay .reward-star {
  font-size: 180px;
  animation: bounce-in 0.8s cubic-bezier(.2,1.6,.4,1);
  filter: drop-shadow(0 0 24px var(--yellow));
}
@keyframes fadein { from { opacity: 0;} to { opacity: 1;} }
@keyframes bounce-in { 0% { transform: scale(0) rotate(-30deg);} 60% { transform: scale(1.3) rotate(10deg);} 100% { transform: scale(1) rotate(0);} }

.muted-note { font-size: 14px; opacity: 0.6; text-align: center; margin-top: auto; padding-top: 12px; }

/* ---------- Színes felület (swatch) ---------- */
.swatch {
  display: inline-block;
  width: 96px;
  height: 96px;
  border-radius: 20px;
  border: 4px solid rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}
.prompt .swatch { width: 140px; height: 140px; }
.choice .swatch { width: 84px; height: 84px; }
.token .swatch, .drop-zone .swatch { width: 72px; height: 72px; }

/* ---------- Analóg óra ---------- */
.clock { width: 220px; height: 220px; max-width: 60vw; display: block; }
.choice .clock { width: 120px; height: 120px; } /* kisebb az opciókban */
.clock-face { fill: #fff; stroke: var(--blue); stroke-width: 3; }
.clock-tick { stroke: var(--ink); stroke-width: 1.2; opacity: 0.55; }
.clock-num { font-size: 9px; font-weight: 800; fill: var(--ink); }
.clock-hand { stroke-linecap: round; }
.clock-hand.hour { stroke: var(--blue-dark); stroke-width: 4; }
.clock-hand.minute { stroke: var(--primary); stroke-width: 2.6; }
.clock-center { fill: var(--primary-dark); }
