:root {
  --ink: #23304a;
  --accent: #d9480f;
  --ok: #2f9e44;
  --no: #e03131;
  --shadow: 0 6px 0 rgba(35, 48, 74, .14);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(180deg, #d8f0ff 0%, #fff6e5 100%) fixed;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 4px solid #ffd43b; outline-offset: 3px; }

.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }

/* ---------- üst çubuk ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--accent); color: #fff;
  position: sticky; top: 0; z-index: 5; box-shadow: 0 3px 0 rgba(0, 0, 0, .12);
}
.bar h1 { margin: 0; flex: 1; text-align: center; font-size: clamp(1.15rem, 4.5vw, 1.7rem); }

/* ---------- düğmeler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 48px; min-height: 48px; padding: 10px 20px;
  border: 0; border-radius: 999px; background: #fff; color: var(--ink);
  font-weight: 800; font-size: 1.1rem; text-decoration: none;
  box-shadow: var(--shadow); transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(35, 48, 74, .14); }
.btn.small { padding: 8px 14px; font-size: 1.4rem; }
.btn.primary { background: var(--accent); color: #fff; }

.card { background: #fff; border-radius: 28px; box-shadow: var(--shadow); padding: 20px; }
.lead { text-align: center; font-size: 1.25rem; margin: 10px 0 0; }
h2 { text-align: center; margin: 14px 0; }

/* ---------- seviye seçimi ---------- */
.levelgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 12px; }
.level {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 22px 12px; border: 0; border-bottom: 8px solid var(--accent);
  border-radius: 28px; background: #fff; box-shadow: var(--shadow);
}
.level:active { transform: translateY(4px); }
.lv-emoji { font-size: 2.8rem; }
.level strong { font-size: 1.7rem; }
.level small { font-size: 1.05rem; color: #51607f; }
.stars { letter-spacing: 2px; font-size: 1.3rem; }

/* ---------- soru ekranı ---------- */
.dots { display: flex; justify-content: center; gap: 8px; margin: 6px 0 14px; flex-wrap: wrap; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }
.dot.done { background: var(--accent); }
.dot.cur { background: #ffd43b; transform: scale(1.35); }

.prompt { display: flex; align-items: center; gap: 12px; min-height: 160px; margin-bottom: 18px; }
.q { flex: 1; text-align: center; }
.ask { font-size: clamp(1.3rem, 5vw, 2rem); font-weight: 800; margin: 8px 0; }
.things { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; line-height: 1.1; }
.bigletter { font-size: clamp(3.5rem, 16vw, 5.5rem); font-weight: 900; line-height: 1; color: var(--accent); }
.bigemoji { font-size: clamp(4rem, 16vw, 6rem); line-height: 1.1; }
.word { display: flex; justify-content: center; gap: 6px; font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 900; letter-spacing: 2px; }
.blank { display: inline-block; min-width: 1.1em; border-bottom: 6px solid var(--accent); color: transparent; }
.mix { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 2.6rem; }

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; }
.opt {
  min-height: 110px; padding: 10px; border: 0; border-bottom: 8px solid rgba(35, 48, 74, .12);
  border-radius: 26px; background: #fff; box-shadow: var(--shadow);
  font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 900;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.opt:active:not(:disabled) { transform: translateY(4px); }
.opt:disabled { cursor: default; }
.opt.right { background: #d3f9d8; outline: 5px solid var(--ok); animation: bounce .5s; }
.opt.wrong { background: #ffe3e3; opacity: .55; animation: shake .35s; }
.options.text .opt { font-size: clamp(1.3rem, 6vw, 2rem); }

.swatch { display: block; width: min(86px, 22vw); aspect-ratio: 1; border-radius: 50%; border: 5px solid rgba(35, 48, 74, .2); }
.swatch.big { width: 130px; margin: 0 auto 6px; }
.lbl { font-size: 1.05rem; font-weight: 800; }

.msg { min-height: 2em; text-align: center; font-weight: 800; font-size: 1.3rem; margin: 14px 0 0; }

/* ---------- toplama ---------- */
.eq { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; font-size: 2.2rem; }
.grp { display: flex; flex-wrap: wrap; gap: 4px; max-width: 210px; justify-content: center; background: #f1f8ff; border-radius: 18px; padding: 8px; }
.op { font-weight: 900; font-size: 2.6rem; }
.sum { font-size: clamp(2.6rem, 11vw, 4.2rem); font-weight: 900; margin: 0; }

/* ---------- örüntü treni ---------- */
.train { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.wag {
  display: grid; place-items: center; min-width: 56px; height: 56px; padding: 0 6px;
  border-radius: 14px; background: #f1f3f5; border-bottom: 5px solid #ced4da;
  font-size: 2rem; font-weight: 900;
}
.wag.q { background: #fff3bf; border-color: #fcc419; color: #e67700; }
.loco { font-size: 2.6rem; }

/* ---------- hafıza ---------- */
.moves { text-align: center; font-weight: 800; font-size: 1.3rem; margin: 6px 0 14px; }
.cards { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 12px; max-width: calc(var(--cols, 4) * 140px); margin: 0 auto; }
.mcard { position: relative; aspect-ratio: 1; padding: 0; border: 0; background: none; perspective: 700px; }
.mf {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 18px;
  font-size: clamp(1.8rem, 9vw, 3.4rem); box-shadow: var(--shadow);
  backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .35s;
}
.mf.front { background: var(--accent); color: #fff; }
.mf.back { background: #fff; transform: rotateY(180deg); }
.mcard.open .front, .mcard.match .front { transform: rotateY(180deg); }
.mcard.open .back, .mcard.match .back { transform: rotateY(0); }
.mcard.match .back { background: #e6fcf5; outline: 4px solid var(--ok); }

/* ---------- bitiş ---------- */
.done { text-align: center; }
.done .big { font-size: 5rem; line-height: 1.1; }
.done .stars { font-size: 2.6rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }

/* ---------- ana sayfa ---------- */
.hero { text-align: center; padding: 32px 16px 8px; }
.hero .logo { font-size: 4rem; }
.hero h1 { margin: 0; font-size: clamp(2rem, 8vw, 3.6rem); }
.hero p { font-size: 1.25rem; margin: 8px 0; }
.pill { display: inline-block; background: #fff; border-radius: 999px; padding: 8px 20px; box-shadow: var(--shadow); font-weight: 800; }
.gamegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin: 18px 0 28px; }
.gcard {
  display: flex; flex-direction: column; gap: 6px; padding: 22px; border-top: 12px solid var(--c);
  border-radius: 30px; background: #fff; text-decoration: none; box-shadow: var(--shadow);
  transition: transform .12s;
}
.gcard:hover { transform: translateY(-4px); }
.gcard:active { transform: translateY(2px); }
.gcard .em { font-size: 3.6rem; line-height: 1.1; }
.gcard h3 { margin: 0; font-size: 1.6rem; }
.gcard p { margin: 0; font-size: 1.05rem; }
.age { font-weight: 800; color: var(--c); }
.parent { margin-bottom: 24px; }
.parent summary { font-weight: 800; font-size: 1.2rem; cursor: pointer; }
.parent li { margin: 8px 0; line-height: 1.5; }
.foot { text-align: center; padding: 16px; font-size: .95rem; color: #51607f; }

/* ---------- animasyonlar ---------- */
.pop {
  position: fixed; z-index: 50; pointer-events: none; font-size: 1.7rem;
  transform: translate(-50%, -50%); animation: pop .9s ease-out forwards;
}
@keyframes pop {
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2); opacity: 0; }
}
@keyframes bounce { 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
