/* =========================================================
   Söz Dedektifleri – Meryem Feyza'nın Anlam Yolculuğu
   Tema: ortaokul öğrencileri için canlı, neşeli, oyun gibi
   ========================================================= */

:root {
  --c-bg-1: #fef6ff;
  --c-bg-2: #eaf4ff;
  --c-bg-3: #fff8e6;
  --c-ink: #1f1147;
  --c-ink-soft: #4b3f7a;
  --c-muted: #7b6fae;
  --c-card: #ffffff;
  --c-card-soft: #f5efff;
  --c-border: rgba(80, 50, 160, 0.12);
  --c-shadow: 0 14px 40px rgba(76, 29, 149, 0.14);
  --c-shadow-strong: 0 22px 60px rgba(76, 29, 149, 0.22);

  --c-primary: #8b5cf6;
  --c-primary-2: #6d28d9;
  --c-secondary: #38bdf8;
  --c-accent: #fb7185;
  --c-success: #10b981;
  --c-warning: #f59e0b;
  --c-danger: #ef4444;

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --font: "Quicksand", "Segoe UI", "Inter", "Nunito", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --font-display: "Fredoka", "Quicksand", "Segoe UI", system-ui, sans-serif;

  --t-fast: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-base: 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-slow: 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Per-deyim renk temaları (kart ve sahne arka planları için) */
.theme-mor      { --c-theme: #8b5cf6; --c-theme-2: #c4b5fd; --c-theme-ink: #4c1d95; }
.theme-mavi     { --c-theme: #38bdf8; --c-theme-2: #bae6fd; --c-theme-ink: #075985; }
.theme-yesil    { --c-theme: #34d399; --c-theme-2: #bbf7d0; --c-theme-ink: #065f46; }
.theme-sari     { --c-theme: #facc15; --c-theme-2: #fef08a; --c-theme-ink: #854d0e; }
.theme-mercan   { --c-theme: #fb7185; --c-theme-2: #fecdd3; --c-theme-ink: #9f1239; }
.theme-pembe    { --c-theme: #f472b6; --c-theme-2: #fbcfe8; --c-theme-ink: #9d174d; }
.theme-turkuaz  { --c-theme: #2dd4bf; --c-theme-2: #99f6e4; --c-theme-ink: #115e59; }
.theme-turuncu  { --c-theme: #fb923c; --c-theme-2: #fed7aa; --c-theme-ink: #9a3412; }
.theme-lacivert { --c-theme: #6366f1; --c-theme-2: #c7d2fe; --c-theme-ink: #312e81; }
.theme-altin    { --c-theme: #eab308; --c-theme-2: #fde68a; --c-theme-ink: #713f12; }

/* ===== Temel ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--c-ink);
  background:
    radial-gradient(1200px 700px at 10% -10%, #ffe3f1 0%, transparent 60%),
    radial-gradient(900px 600px at 110% 10%, #d9ecff 0%, transparent 60%),
    radial-gradient(700px 500px at 50% 110%, #fff3c8 0%, transparent 60%),
    linear-gradient(180deg, var(--c-bg-1), var(--c-bg-2) 60%, var(--c-bg-3));
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  letter-spacing: 0.1px;
}

button { font-family: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid #c084fc; outline-offset: 3px; border-radius: 12px; }

/* ===== Arka plan dekorları ===== */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-decor .shape {
  position: absolute;
  display: block;
  opacity: 0.55;
  filter: blur(0.2px);
  animation: float 18s ease-in-out infinite;
}
.shape-cloud  { top:  8%; left:  4%; width: 120px; height: 70px;
  background: radial-gradient(circle at 30% 50%, #fff 0 30%, transparent 31%),
              radial-gradient(circle at 55% 40%, #fff 0 35%, transparent 36%),
              radial-gradient(circle at 75% 55%, #fff 0 30%, transparent 31%);
}
.shape-star   { top: 16%; right: 8%; width: 36px; height: 36px;
  background: conic-gradient(from 45deg, #fde68a 0 25%, #facc15 0 50%, #fde68a 0 75%, #facc15 0 100%);
  clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
  animation-duration: 22s;
}
.shape-book   { bottom: 12%; left:  6%; width: 70px; height: 50px;
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  border-radius: 6px 14px 6px 14px;
  box-shadow: inset 8px 0 0 #ddd6fe, 0 6px 16px rgba(124,58,237,0.25);
  animation-duration: 26s;
}
.shape-bubble { top: 60%; right: 14%; width: 56px; height: 56px;
  background: radial-gradient(circle at 30% 30%, #fff, #bae6fd 70%);
  border-radius: 50%;
  animation-duration: 20s;
}
.shape-leaf   { bottom: 24%; right: 6%; width: 56px; height: 30px;
  background: radial-gradient(circle at 100% 50%, #34d399 60%, transparent 61%);
  border-radius: 0 30px 0 30px;
  animation-duration: 28s;
}
.shape-heart  { top: 40%; left: 12%; width: 28px; height: 28px;
  background: #fb7185;
  clip-path: path("M14 26 C 2 18 2 8 8 6 C 12 4 14 8 14 8 C 14 8 16 4 20 6 C 26 8 26 18 14 26 Z");
  animation-duration: 24s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0) rotate(0); }
  50%      { transform: translateY(-24px) translateX(10px) rotate(6deg); }
}

/* ===== Üst bar ===== */
.top-bar {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 28px;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: 14px;
  transition: background var(--t-fast);
}
.logo:hover { background: rgba(139,92,246,0.08); }
.logo-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 24px;
  background: linear-gradient(135deg, #c4b5fd, #fbcfe8);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(139,92,246,0.25);
  animation: pulse 4s ease-in-out infinite;
}
.logo-text { display: grid; text-align: left; line-height: 1.1; }
.logo-text strong { font-size: 17px; color: var(--c-ink); }
.logo-text small  { font-size: 12px; color: var(--c-muted); }

.top-info { display: flex; align-items: center; gap: 12px; }

.progress-wrap { display: flex; align-items: center; gap: 10px; }
.progress-bar {
  width: 160px; height: 12px;
  background: #ede9fe;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(76,29,149,0.1);
}
.progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #a78bfa, #f472b6, #fbbf24);
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width var(--t-slow);
  animation: shimmer 4s linear infinite;
}
.progress-label { font-weight: 700; color: var(--c-ink-soft); font-size: 14px; }

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-ink-soft);
  padding: 9px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.ghost-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(76,29,149,0.12); }
.ghost-btn--soft { background: rgba(255,255,255,0.7); color: var(--c-muted); }

/* ===== App container ===== */
.app {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.view { animation: viewIn var(--t-slow) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Home / Kapak ===== */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
  background: linear-gradient(140deg, #ede9fe, #fce7f3 60%, #fef3c7);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--c-shadow-strong);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -2px;
  border-radius: var(--radius-xl);
  padding: 2px;
  background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,255,255,0));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--c-ink);
}
.hero h1 .sub {
  display: block;
  font-size: 0.45em;
  color: var(--c-primary-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-bottom: 8px;
}
.hero p { color: var(--c-ink-soft); font-size: 17px; line-height: 1.55; }

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

.btn {
  border: 0;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 22px;
  border-radius: 14px;
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-fast);
}
.btn-primary {
  background: linear-gradient(135deg, var(--c-primary), #ec4899);
  color: #fff;
  box-shadow: 0 14px 30px rgba(139,92,246,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(139,92,246,0.45); }
.btn-secondary {
  background: #fff;
  color: var(--c-primary-2);
  border: 1px solid var(--c-border);
  box-shadow: 0 6px 14px rgba(76,29,149,0.1);
}
.btn-secondary:hover { transform: translateY(-2px); }
.btn-ghost {
  background: transparent; color: var(--c-muted);
}

.hero-art {
  position: relative; aspect-ratio: 1/1; max-width: 360px; justify-self: center; width: 100%;
}
.hero-art .magnify {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 160px;
  filter: drop-shadow(0 24px 30px rgba(124,58,237,0.25));
  animation: bobble 6s ease-in-out infinite;
}
.hero-art .word {
  position: absolute;
  padding: 8px 14px;
  background: #fff;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  color: var(--c-ink);
  box-shadow: 0 10px 22px rgba(76,29,149,0.18);
  animation: floatPill 7s ease-in-out infinite;
}
.hero-art .w1 { top: 6%;  left: -2%; color: #6d28d9; animation-delay: 0.1s; }
.hero-art .w2 { top: 18%; right: -4%; color: #be185d; animation-delay: 0.8s; }
.hero-art .w3 { bottom: 22%; left: -6%; color: #047857; animation-delay: 1.6s; }
.hero-art .w4 { bottom: 6%;  right: 0%; color: #b45309; animation-delay: 2.4s; }

@keyframes bobble {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50%      { transform: rotate(4deg) translateY(-10px); }
}
@keyframes floatPill {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

.intro-grid {
  margin-top: 26px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}
.intro-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--c-shadow);
  display: grid;
  gap: 8px;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.intro-card:hover { transform: translateY(-4px); box-shadow: var(--c-shadow-strong); }
.intro-card .ic {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 22px;
  background: linear-gradient(135deg, #ede9fe, #fbcfe8);
}
.intro-card h3 { margin: 6px 0 2px; font-size: 17px; }
.intro-card p { margin: 0; color: var(--c-muted); font-size: 14px; line-height: 1.5; }

/* ===== Harita / Kart Izgarası ===== */
.map-head {
  display: flex; justify-content: space-between; align-items: end;
  gap: 16px; margin-bottom: 18px;
}
.map-head h2 { margin: 0; font-size: 26px; color: var(--c-ink); }
.map-head p  { margin: 4px 0 0; color: var(--c-muted); font-size: 15px; }
.map-head .filters { display: flex; gap: 8px; }
.filter-btn {
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-ink-soft);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background var(--t-fast), color var(--t-fast);
}
.filter-btn.is-active {
  background: var(--c-ink);
  color: #fff;
  border-color: transparent;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 22px;
  background: linear-gradient(160deg, var(--c-theme-2), #fff 80%);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: var(--c-shadow);
  cursor: pointer;
  text-align: left;
  width: 100%;
  display: grid;
  gap: 10px;
  overflow: hidden;
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.card::after {
  content: "";
  position: absolute; right: -30px; bottom: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--c-theme);
  opacity: 0.15;
  transition: transform var(--t-slow);
}
.card:hover { transform: translateY(-6px) rotate(-0.4deg); box-shadow: var(--c-shadow-strong); }
.card:hover::after { transform: scale(1.3); }

.card .emoji {
  font-size: 42px;
  width: 60px; height: 60px;
  display: grid; place-items: center;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.06);
}
.card .badge-tag {
  position: absolute; top: 16px; right: 16px;
  font-size: 11px; font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.8);
  color: var(--c-theme-ink);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.card .num {
  font-size: 12px; font-weight: 700; color: var(--c-theme-ink); opacity: 0.7;
}
.card h3 {
  margin: 0;
  color: var(--c-ink);
  font-size: 19px;
  line-height: 1.25;
  word-break: break-word;
  hyphens: auto;
}
.card .teaser { margin: 0; color: var(--c-ink-soft); font-size: 14px; }
.card .footer-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 6px;
  font-size: 13px; color: var(--c-theme-ink); font-weight: 700;
}
.card .check {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c-theme);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--t-base), transform var(--t-base);
}
.card.is-done .check { opacity: 1; transform: scale(1); }
.card.is-done { box-shadow: 0 10px 28px rgba(16,185,129,0.22); }

/* ===== Lesson / Adım anlatımı ===== */
.lesson {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--c-shadow-strong);
  overflow: hidden;
  position: relative;
}
.lesson-head {
  display: flex; gap: 16px; align-items: center;
  padding: 24px 28px;
  background: linear-gradient(120deg, var(--c-theme-2), #fff);
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.lesson-head .ico {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: #fff;
  display: grid; place-items: center;
  font-size: 36px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.08);
}
.lesson-head h2 {
  margin: 0;
  color: var(--c-ink);
  font-size: 24px;
  line-height: 1.2;
  word-break: break-word;
}
.lesson-head .tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--c-theme);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.lesson-head .back-btn {
  margin-left: auto;
}

.steps {
  display: flex; gap: 8px;
  padding: 14px 28px 0;
}
.steps .step {
  flex: 1; height: 8px;
  background: #ede9fe;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.steps .step::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--c-theme), var(--c-primary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-slow);
}
.steps .step.is-active::after,
.steps .step.is-done::after { transform: scaleX(1); }

.lesson-body {
  padding: 26px 28px 28px;
  min-height: 320px;
}
.step-panel { animation: viewIn var(--t-base) both; }

.story {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 18px;
  padding: 22px;
  background: linear-gradient(135deg, var(--c-theme-2), #fff 90%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,0.04);
}
.story .scene {
  width: 80px; height: 80px;
  display: grid; place-items: center;
  font-size: 48px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 22px rgba(0,0,0,0.06);
  animation: bobble 5s ease-in-out infinite;
}
.story h3 { margin: 0 0 6px; color: var(--c-theme-ink); }
.story p  { margin: 0; color: var(--c-ink-soft); font-size: 16px; line-height: 1.6; }

/* Hikaye sahnesinde görsel varsa: solda görsel, sağda açıklama */
.story.has-image {
  grid-template-columns: minmax(240px, 46%) 1fr;
  gap: 24px;
  align-items: center;
}
.story-figure {
  margin: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c-theme-2), #fff);
  border: 3px solid #fff;
  box-shadow:
    0 0 0 2px var(--c-theme, #c4b5fd),
    0 18px 40px rgba(76, 29, 149, 0.18);
  transition: transform var(--t-base), box-shadow var(--t-base);
  animation: storyImageIn 600ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  min-width: 0;
}
.story.has-image .story-figure {
  align-self: stretch;
  height: 100%;
}
.story-figure:hover { transform: translateY(-3px); box-shadow:
    0 0 0 2px var(--c-theme, #c4b5fd),
    0 22px 50px rgba(76, 29, 149, 0.26);
}
.story-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: min(480px, 68vh);
  object-fit: contain;
  object-position: center;
}

.story-body {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 18px;
  align-items: start;
}
.story.has-image .story-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  text-align: left;
  min-width: 0;
}
.story.has-image .story-body .scene {
  width: 64px;
  height: 64px;
  font-size: 36px;
  border-radius: 18px;
  flex-shrink: 0;
}
.story.has-image .story-body h3 {
  font-size: 20px;
}
.story.has-image .story-body p {
  font-size: 16px;
}

@keyframes storyImageIn {
  0%   { opacity: 0; transform: translateY(10px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Hikaye görseli + büyütme */
.story-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.story-figure--clickable {
  cursor: zoom-in;
  width: 100%;
}
.story-figure--clickable:focus-visible {
  outline: 3px solid var(--c-theme, #8b5cf6);
  outline-offset: 4px;
}
.story-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  min-height: 44px;
  border: 2px solid var(--c-theme, #c4b5fd);
  background: linear-gradient(135deg, #fff, var(--c-theme-2, #ede9fe));
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--c-theme-ink, #4c1d95);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(76, 29, 149, 0.12);
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.story-zoom-btn .zoom-icon {
  font-size: 18px;
  line-height: 1;
}
.story-zoom-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(76, 29, 149, 0.18);
}
.story-zoom-btn:active { transform: scale(0.98); }

/* Lightbox */
body.lightbox-open { overflow: hidden; }
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.image-lightbox[hidden] { display: none !important; }
.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 40, 0.9);
  backdrop-filter: blur(6px);
}
.image-lightbox-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--c-ink);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform var(--t-fast);
}
.image-lightbox-close:hover { transform: scale(1.08); }
.image-lightbox-inner {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(1024px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: lightboxIn 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.image-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: min(82vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  background: #fff;
}
.image-lightbox-caption {
  margin: 0;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: var(--c-ink);
  text-align: center;
  max-width: 90vw;
}
@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.choices {
  display: grid; gap: 12px; margin-top: 18px;
}
.choice {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 16px;
  background: #fff;
  border: 2px solid #ede9fe;
  border-radius: 14px;
  text-align: left;
  color: var(--c-ink);
  font-weight: 600;
  font-size: 15px;
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.choice .dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid #c4b5fd;
  display: grid; place-items: center;
  font-size: 12px;
  color: transparent;
  background: #fff;
  transition: all var(--t-fast);
}
.choice:hover { transform: translateY(-2px); border-color: var(--c-theme); }
.choice.is-correct {
  border-color: #34d399; background: #ecfdf5; color: #065f46;
}
.choice.is-correct .dot { background: #10b981; border-color: #10b981; color: #fff; }
.choice.is-wrong {
  border-color: #fda4af; background: #fff1f2; color: #9f1239;
}
.choice.is-wrong .dot { background: #ef4444; border-color: #ef4444; color: #fff; }
.choice[disabled] { cursor: not-allowed; opacity: 0.85; }

.callout {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0fdf4, #ecfeff);
  border: 1px dashed #a7f3d0;
  color: #065f46;
  font-weight: 600;
}
.callout.is-meaning {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border-color: #fde68a;
  color: #92400e;
}
.callout.is-example {
  background: linear-gradient(135deg, #eff6ff, #ede9fe);
  border-color: #c4b5fd;
  color: #3730a3;
}

.lesson-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 22px; gap: 12px; flex-wrap: wrap;
}
.lesson-actions .hint { color: var(--c-muted); font-size: 13px; }

/* Mini görev */
.activity {
  display: grid;
  gap: 14px;
}
.activity h3 { margin: 0; color: var(--c-theme-ink); font-size: 18px; }
.activity p.q { margin: 0; color: var(--c-ink-soft); font-size: 16px; }

/* ===== Rozet / Tebrik ===== */
.badge-screen {
  display: grid; place-items: center;
  text-align: center;
  padding: 40px 16px;
}
.badge-screen .medal {
  width: 160px; height: 160px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 80px;
  background: radial-gradient(circle at 30% 30%, #fffbeb, var(--c-theme));
  box-shadow: 0 22px 50px rgba(0,0,0,0.18),
              inset 0 -10px 20px rgba(0,0,0,0.1),
              inset 0 6px 14px rgba(255,255,255,0.7);
  animation: medalSpin 1.2s var(--t-slow) both, bobble 6s ease-in-out infinite 1.2s;
}
@keyframes medalSpin {
  0%   { transform: rotate(-180deg) scale(0.4); opacity: 0; }
  60%  { transform: rotate(20deg) scale(1.08); opacity: 1; }
  100% { transform: rotate(0deg) scale(1); }
}
.badge-screen h2 { margin: 18px 0 6px; font-size: 28px; color: var(--c-ink); }
.badge-screen p  { margin: 0 0 18px; color: var(--c-muted); max-width: 480px; }

/* ===== Rozetler ekranı ===== */
.badges-wrap { display: grid; gap: 16px; }
.badges-wrap h2 { margin: 0; }
.badges-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.badge-card {
  display: grid; place-items: center; gap: 8px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--c-shadow);
  text-align: center;
  border: 1px solid var(--c-border);
}
.badge-card .medal-sm {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 36px;
  background: radial-gradient(circle at 30% 30%, #fffbeb, var(--c-theme, #d4d4d8));
  box-shadow: inset 0 -6px 12px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.08);
}
.badge-card.is-locked .medal-sm {
  background: #f3f4f6; color: #9ca3af; box-shadow: none;
}
.badge-card.is-locked { opacity: 0.7; }
.badge-card strong { font-size: 14px; color: var(--c-ink); }
.badge-card small  { font-size: 12px; color: var(--c-muted); }

/* ===== Footer ===== */
.footer {
  position: relative; z-index: 1;
  text-align: center;
  padding: 20px;
  color: var(--c-muted);
  font-size: 13px;
}
.footer strong { color: var(--c-ink-soft); }
.footer-dot { margin: 0 8px; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 12px 18px;
  background: var(--c-ink);
  color: #fff;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  opacity: 0; pointer-events: none;
  box-shadow: 0 16px 30px rgba(0,0,0,0.18);
  transition: opacity var(--t-base), transform var(--t-base);
  z-index: 30;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Confetti ===== */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 25; overflow: hidden; }
.confetti .piece {
  position: absolute; top: -20px;
  width: 10px; height: 14px;
  background: #fbbf24;
  opacity: 0.95;
  border-radius: 2px;
  animation: fall 2.6s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
}
@keyframes fall {
  0%   { transform: translateY(-20px) rotate(0); }
  100% { transform: translateY(110vh) rotate(720deg); }
}

/* ===== Responsive ===== */

/* --- Tablet (≤1024px) --- */
@media (max-width: 1024px) {
  .intro-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .story.has-image {
    grid-template-columns: minmax(200px, 44%) 1fr;
    gap: 20px;
  }
}

/* --- Mobil / küçük tablet (≤880px) --- */
@media (max-width: 880px) {
  .app {
    padding: 16px 16px 48px;
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  }

  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }
  .top-info {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .progress-wrap {
    grid-column: 1 / -1;
    min-width: 0;
  }
  .progress-bar { width: 100%; min-width: 0; }

  .hero {
    grid-template-columns: 1fr;
    padding: 24px 20px;
    gap: 20px;
  }
  .hero h1 { font-size: clamp(24px, 6vw, 34px); }
  .hero-art { max-width: 240px; order: -1; justify-self: center; }
  .intro-grid { grid-template-columns: 1fr; }

  .map-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .map-head .filters { flex-wrap: wrap; }

  .lesson-head {
    flex-wrap: wrap;
    padding: 16px 18px;
    gap: 12px;
  }
  .lesson-head .back-btn {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  .lesson-head h2 { font-size: clamp(17px, 4.5vw, 22px); }
  .lesson-body { padding: 18px 16px; min-height: 0; }
  .steps { padding: 10px 16px 0; gap: 5px; }

  /* Hikaye: üstte görsel, altta metin */
  .story {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }
  .story.has-image {
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: stretch;
  }
  .story.has-image .story-figure {
    align-self: auto;
    height: auto;
    width: 100%;
  }
  .story-media { width: 100%; }
  .story-zoom-btn { width: 100%; max-width: 280px; }
  .story.has-image .story-body {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 10px 14px;
    text-align: left;
    align-items: start;
  }
  .story.has-image .story-body .scene {
    grid-column: 1;
    grid-row: 1;
    width: 56px;
    height: 56px;
    font-size: 32px;
    border-radius: 16px;
    margin: 0;
  }
  .story.has-image .story-body > div {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }
  .story.has-image .story-body h3 { font-size: 18px; }
  .story.has-image .story-body p { font-size: 15px; line-height: 1.65; }

  .story:not(.has-image) {
    text-align: center;
  }
  .story:not(.has-image) .scene { margin: 0 auto; }
  .story:not(.has-image) .story-body {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .story:not(.has-image) .story-body .scene { margin: 0 auto; }

  .story-image { max-height: min(360px, 48vh); }

  .lesson-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .lesson-actions .hint {
    text-align: center;
    font-size: 13px;
    line-height: 1.45;
  }
  .lesson-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .badge-screen .medal { width: 130px; height: 130px; font-size: 64px; }
}

/* --- Küçük telefon (≤520px) --- */
@media (max-width: 520px) {
  body {
    background:
      radial-gradient(700px 500px at 50% -10%, #ffe3f1 0%, transparent 60%),
      linear-gradient(180deg, var(--c-bg-1), var(--c-bg-2) 60%, var(--c-bg-3));
  }
  .bg-decor .shape { opacity: 0.28; transform: scale(0.85); }
  .shape-cloud, .shape-leaf { display: none; }

  .app { padding: 12px 12px 40px; }

  .logo { padding: 4px 6px; gap: 10px; }
  .logo-icon { width: 40px; height: 40px; font-size: 20px; }
  .logo-text strong { font-size: 14px; }
  .logo-text small { font-size: 10px; line-height: 1.3; }

  .ghost-btn {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
  }
  .ghost-btn span:not([aria-hidden]) { display: none; }

  .hero {
    padding: 20px 16px;
    border-radius: 22px;
  }
  .hero h1 { font-size: clamp(21px, 7vw, 28px); }
  .hero p { font-size: 15px; line-height: 1.55; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }
  .hero-art { max-width: 180px; }
  .hero-art .magnify { font-size: 100px; }
  .hero-art .word { font-size: 11px; padding: 5px 9px; }

  .card-grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 16px; }
  .card .emoji { width: 50px; height: 50px; font-size: 32px; }
  .card h3 { font-size: 16px; }

  .filter-btn { padding: 8px 12px; font-size: 12px; }

  .lesson { border-radius: 20px; }
  .lesson-head { padding: 14px; }
  .lesson-head .ico { width: 48px; height: 48px; font-size: 26px; border-radius: 14px; }
  .lesson-head h2 { font-size: 17px; }
  .lesson-body { padding: 14px 12px; }
  .steps { padding: 8px 12px 0; gap: 3px; }
  .steps .step { height: 5px; }

  .story { padding: 14px; border-radius: 16px; }
  .story.has-image { gap: 14px; }
  .story.has-image .story-body {
    grid-template-columns: 48px 1fr;
    gap: 8px 12px;
  }
  .story.has-image .story-body .scene {
    width: 48px;
    height: 48px;
    font-size: 28px;
    border-radius: 14px;
  }
  .story.has-image .story-body h3 { font-size: 16px; }
  .story.has-image .story-body p { font-size: 14px; }

  .story-image { max-height: min(280px, 42vh); }
  .story-figure { border-radius: 16px; border-width: 2px; }
  .story-zoom-btn { font-size: 13px; padding: 9px 16px; }

  .choice {
    padding: 12px 14px;
    font-size: 14px;
    min-height: 48px;
  }
  .choice .dot { width: 22px; height: 22px; flex-shrink: 0; }
  .callout { padding: 12px 14px; font-size: 14px; }

  .activity h3 { font-size: 16px; }
  .activity p.q { font-size: 14px; }

  .badge-screen { padding: 24px 8px; }
  .badge-screen .medal { width: 100px; height: 100px; font-size: 50px; }
  .badge-screen h2 { font-size: 20px; }

  .badges-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .badge-card { padding: 12px; }
  .badge-card .medal-sm { width: 52px; height: 52px; font-size: 26px; }
  .badge-card strong { font-size: 12px; }
  .badge-card small { font-size: 10px; }

  .footer {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    font-size: 11px;
    padding: 14px 12px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .footer-dot { display: none; }

  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateY(20px);
    width: auto;
    text-align: center;
  }
  .toast.is-show { transform: translateY(0); }
}

/* --- Çok küçük ekran (≤360px) --- */
@media (max-width: 360px) {
  .hero h1 { font-size: 20px; }
  .hero-art { display: none; }
  .badges-grid { grid-template-columns: 1fr; }
  .story.has-image .story-body {
    grid-template-columns: 1fr;
  }
  .story.has-image .story-body .scene {
    justify-self: start;
  }
  .story-image { max-height: min(240px, 38vh); }
}

/* --- Dokunmatik cihazlar --- */
@media (hover: none) {
  .card:hover { transform: none; }
  .intro-card:hover { transform: none; }
  .btn:hover, .ghost-btn:hover { transform: none; }
  .story-figure:hover { transform: none; }
  .story-zoom-btn:hover { transform: none; }
  .image-lightbox-close:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
