/* =========================================================
   Sokak Hayvanları Kahramanı — Stil Dosyası
   Akıllı tahta için büyük butonlar ve okunaklı yazılar
   ========================================================= */
:root {
  --bg1: #c9f0ff;
  --bg2: #fff4d9;
  --ink: #2b2d42;
  --muted: #6b6f85;
  --card: #ffffff;
  --primary: #ff7a3d;
  --primary-d: #e2591b;
  --green: #22b866;
  --green-d: #178a4b;
  --green-l: #dcfce7;
  --red: #ef4d5a;
  --red-d: #c42c3a;
  --red-l: #fee2e2;
  --orange-l: #fff1dc;
  --purple: #7b5cff;
  --purple-d: #5b3fe0;
  --yellow: #ffd23f;
  --shadow: 0 12px 32px rgba(43, 45, 66, .16);
  --radius: 26px;
  --board-w: min(360px, 88vw);
  --font: 'Baloo 2', 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --emoji: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  font-size: clamp(15px, 0.75vw + 6px, 22px);
}
html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1) 0%, #e6f7ff 45%, var(--bg2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Arka plan patileri ---------- */
.bg-paws { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-paws span {
  position: absolute;
  font-family: var(--emoji);
  opacity: .12;
  animation: pawFloat var(--dur, 14s) ease-in-out infinite alternate;
}
@keyframes pawFloat {
  from { transform: translateY(0) rotate(var(--r, 0deg)); }
  to   { transform: translateY(-40px) rotate(calc(var(--r, 0deg) + 25deg)); }
}

/* ---------- Genel yerleşim ---------- */
#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 20px 24px 56px;
  transition: padding-right .45s cubic-bezier(.2, .9, .3, 1);
}
@media (min-width: 1100px) {
  body.board-open #app { padding-right: calc(var(--board-w) + 28px); }
}

.screen { display: none; min-height: calc(100vh - 76px); }
.screen.active { display: flex; flex-direction: column; animation: screenIn .7s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(40px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Butonlar ---------- */
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 1.3rem;
  border: 0;
  border-radius: 999px;
  padding: .65em 1.4em;
  cursor: pointer;
  color: #fff;
  background: var(--purple);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .18);
  transition: transform .15s, box-shadow .15s, background .2s, opacity .2s;
  touch-action: manipulation;
  user-select: none;
  line-height: 1.2;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.btn:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; }
.btn.small { font-size: 1rem; padding: .45em 1em; }

.btn-primary { background: var(--primary); box-shadow: 0 6px 0 var(--primary-d); }
.btn-yellow  { background: var(--yellow); color: var(--ink); box-shadow: 0 6px 0 #d9a900; }
.btn-ghost   { background: #fff; color: var(--ink); border: 3px solid #e3e6f2; box-shadow: 0 5px 0 #dcdff0; }
.btn-icon    { background: #fff; color: var(--ink); font-size: 1.15rem; padding: .5em .85em; border: 3px solid #e3e6f2; box-shadow: 0 5px 0 #dcdff0; }

.btn-start {
  font-size: 2rem;
  padding: .55em 1.6em;
  background: linear-gradient(135deg, #2fd27a, #12a35a);
  box-shadow: 0 8px 0 #0c7a42, 0 14px 30px rgba(18, 163, 90, .35);
}
.btn-start:not(:disabled) { animation: startPulse 2.2s ease-in-out infinite; }
@keyframes startPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ---------- Giriş ekranı ---------- */
#setup { align-items: center; justify-content: center; }
.setup-card {
  width: min(960px, 100%);
  background: rgba(255, 255, 255, .94);
  border-radius: 36px;
  box-shadow: var(--shadow);
  padding: 2rem 2.4rem 1.6rem;
  text-align: center;
  border: 6px solid #fff;
}
.hero-animals { display: flex; justify-content: center; gap: 1.2rem; font-family: var(--emoji); font-size: 3.4rem; }
.hero-animals span { display: inline-block; animation: heroBounce 1.6s ease-in-out infinite; }
.hero-animals span:nth-child(2) { animation-delay: .15s; }
.hero-animals span:nth-child(3) { animation-delay: .3s; }
.hero-animals span:nth-child(4) { animation-delay: .45s; }
.hero-animals span:nth-child(5) { animation-delay: .6s; }
@keyframes heroBounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  40% { transform: translateY(-18px) rotate(-6deg); }
  60% { transform: translateY(-10px) rotate(6deg); }
}

.title {
  margin: .2rem 0 .3rem;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--ink);
  text-shadow: 0 4px 0 rgba(0, 0, 0, .06);
}
.title span {
  background: linear-gradient(90deg, var(--primary), #ff3d7f, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.author {
  display: inline-block;
  margin: .3rem 0 .8rem;
  padding: .35em 1.2em;
  font-size: 1.45rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff1b8, #ffd6e7);
  border: 3px solid #ffc94d;
  animation: authorGlow 2.5s ease-in-out infinite;
}
@keyframes authorGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 201, 77, .6); }
  50% { box-shadow: 0 0 0 12px rgba(255, 201, 77, 0); }
}
.subtitle { font-size: 1.25rem; color: var(--muted); margin: 0 0 1.2rem; line-height: 1.5; }
.subtitle .c1 { color: #e58600; }
.subtitle .c2 { color: #2f6fd8; }
.subtitle .c3 { color: #d93361; }

.add-form { display: flex; gap: .8rem; max-width: 760px; margin: 0 auto; }
.add-form input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 1.6rem;
  font-weight: 600;
  padding: .45em 1em;
  border-radius: 999px;
  border: 4px solid #ffd7c2;
  outline: none;
  color: var(--ink);
  background: #fffaf6;
  transition: border-color .2s, box-shadow .2s;
}
.add-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 6px rgba(255, 122, 61, .18); }
.add-msg { min-height: 1.6em; margin: .4rem 0 .2rem; color: var(--red); font-weight: 700; font-size: 1.1rem; }
.add-msg.shake { animation: shake .45s; }

.roster-head { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-bottom: .6rem; }
.roster-count { font-weight: 800; font-size: 1.3rem; color: var(--purple); }
.check { font-size: 1.15rem; font-weight: 600; display: inline-flex; align-items: center; gap: .4em; cursor: pointer; }
.check input { width: 1.4em; height: 1.4em; accent-color: var(--purple); }

.roster {
  list-style: none;
  padding: .8rem;
  margin: 0 0 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  max-height: 32vh;
  overflow-y: auto;
  border-radius: 20px;
  background: #f7f8ff;
  min-height: 4.2rem;
}
.roster:empty::before { content: 'Henüz kahraman eklenmedi. Yukarıdan isim ekleyin! 🐾'; color: var(--muted); font-size: 1.15rem; align-self: center; }
.roster li {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.3rem;
  font-weight: 700;
  padding: .25em .35em .25em .35em;
  border-radius: 999px;
  background: #fff;
  border: 3px solid #ffd7c2;
}
.roster li.new { animation: chipIn .5s cubic-bezier(.2, .9, .3, 1.4); }
.roster .num {
  display: inline-grid; place-items: center;
  width: 1.8em; height: 1.8em;
  border-radius: 50%;
  background: var(--primary); color: #fff; font-size: .85em;
}
.roster .remove {
  border: 0; cursor: pointer;
  width: 1.8em; height: 1.8em; border-radius: 50%;
  background: var(--red-l); color: var(--red-d); font-weight: 800; font-size: .85em;
  font-family: inherit;
}
.roster .remove:hover { background: var(--red); color: #fff; }
@keyframes chipIn {
  from { opacity: 0; transform: scale(.3) rotate(-10deg); }
  to   { opacity: 1; transform: none; }
}
.hint { color: var(--muted); font-size: 1rem; margin: 1rem 0 0; }
.voice-msg { color: #b45309; font-size: 1rem; margin: .3rem 0 0; min-height: 1em; }
.voice-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; font-weight: 700; font-size: 1.1rem; }
.voice-row select {
  font-family: inherit; font-size: 1.05rem; font-weight: 600; color: var(--ink);
  padding: .4em .8em; border-radius: 14px; border: 3px solid #e3e6f2; background: #fff;
  max-width: 100%;
}

/* ---------- Oyun ekranı: üst bar ---------- */
.game-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.4rem;
  padding: .7rem 1.2rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
}
.player-badge { display: flex; align-items: center; gap: .8rem; }
.avatar {
  width: 3.6rem; height: 3.6rem;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 2rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--purple), #ff3d7f);
  box-shadow: 0 5px 0 var(--purple-d);
}
.label { font-size: .95rem; color: var(--muted); font-weight: 600; line-height: 1; }
.pname { font-size: 2.1rem; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.pname.long { font-size: 1.6rem; }
.player-badge { min-width: 0; max-width: 100%; }
.player-badge > div:last-child { min-width: 0; }
.avatar { flex: none; }
.pname.pop { animation: namePop .6s; transform-origin: left center; }
@keyframes namePop { 40% { transform: scale(1.06); } }

.stages { list-style: none; display: flex; gap: .5rem; margin: 0; padding: 0; flex-wrap: wrap; }
.stages li {
  padding: .35em .9em;
  border-radius: 999px;
  background: #eef0fa;
  color: var(--muted);
  font-weight: 700;
  font-size: 1.1rem;
  transition: all .35s;
}
.stages li.active { background: var(--c); color: #fff; transform: scale(1.08); box-shadow: 0 5px 0 rgba(0, 0, 0, .15); }
.stages li.done { background: var(--green-l); color: var(--green-d); }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.progress-chip { font-weight: 800; font-size: 1.15rem; padding: .35em .9em; background: #fff4d0; border-radius: 999px; }
body.speaking #repeatBtn { animation: speakPulse 1s ease-in-out infinite; border-color: var(--purple); }
@keyframes speakPulse {
  0%, 100% { box-shadow: 0 5px 0 #dcdff0, 0 0 0 0 rgba(123, 92, 255, .5); }
  50% { box-shadow: 0 5px 0 #dcdff0, 0 0 0 10px rgba(123, 92, 255, 0); }
}

/* ---------- Oyun alanı ---------- */
.play {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 1.3rem;
  margin-top: 1.1rem;
}
@media (max-width: 1000px) {
  .play { grid-template-columns: 1fr; }
  .scene { min-height: 280px !important; }
}

/* ---------- Sahne (hikaye animasyonu) ---------- */
.scene {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius);
  min-height: 440px;
  border: 6px solid #fff;
  box-shadow: var(--shadow);
  background: #7fd3ff;
}
.scene.enter { animation: sceneIn .7s ease; }
@keyframes sceneIn {
  from { opacity: 0; transform: scale(.94); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.scene .sky { position: absolute; inset: 0; transition: background .6s; }
.w-sun   .sky { background: linear-gradient(#6ccbff, #d8f4ff); }
.w-hot   .sky { background: linear-gradient(#ff9f43, #ffe29a); }
.w-cloud .sky { background: linear-gradient(#94adc2, #e3edf5); }
.w-rain  .sky { background: linear-gradient(#55697e, #a5b5c4); }
.w-snow  .sky { background: linear-gradient(#a2c2dd, #f0f7fc); }
.w-wind  .sky { background: linear-gradient(#86c5e4, #e0f2fe); }
.w-storm .sky { background: linear-gradient(#232c3d, #56657b); }
.w-night .sky { background: linear-gradient(#0d1838, #33407a); }

.weather-tag {
  position: absolute; top: 12px; left: 12px; z-index: 8;
  background: rgba(255, 255, 255, .88);
  padding: .2em .8em;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
}

.ground {
  position: absolute; left: -10%; right: -10%; bottom: 0; height: 30%;
  border-radius: 50% 50% 0 0 / 40px 40px 0 0;
  background: linear-gradient(#8bd17c, #5aae55);
}
.w-snow  .ground { background: linear-gradient(#ffffff, #d8e8f5); }
.w-hot   .ground { background: linear-gradient(#f4d37a, #d9a84a); }
.w-night .ground { background: linear-gradient(#2f5d3a, #1d3d27); }
.w-rain  .ground, .w-storm .ground { background: linear-gradient(#6f9a62, #4c7444); }
.w-cloud .ground { background: linear-gradient(#80bd72, #5a9a52); }
.puddle {
  position: absolute; bottom: 6%; height: 14px; border-radius: 50%;
  background: rgba(170, 210, 255, .7);
  animation: puddle 1.4s ease-in-out infinite;
}
@keyframes puddle { 50% { transform: scaleX(1.12); opacity: .8; } }

/* Güneş */
.sun { position: absolute; top: 7%; right: 9%; width: 110px; height: 110px; z-index: 1; }
.sun .rays {
  position: absolute; inset: -34px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 214, 63, .65) 0 10deg, transparent 10deg 30deg);
  animation: spin 22s linear infinite;
}
.sun .core {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff9b0, #ffd23f 60%, #ffb400);
  box-shadow: 0 0 60px #ffd23f;
  animation: sunPulse 3s ease-in-out infinite;
}
.sun.big { width: 150px; height: 150px; top: 5%; }
.sun.big .core { background: radial-gradient(circle at 40% 40%, #fff3a0, #ffb400 55%, #ff7a00); box-shadow: 0 0 90px #ff9500; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sunPulse { 50% { transform: scale(1.06); } }

/* Isı dalgaları */
.heat { position: absolute; inset: 35% 0 25% 0; z-index: 2; pointer-events: none; }
.heat i {
  position: absolute; left: 10%; right: 10%; height: 18px; border-radius: 50%;
  background: rgba(255, 255, 255, .35); filter: blur(6px);
  animation: heatRise 3s ease-in infinite;
}
.heat i:nth-child(2) { animation-delay: 1s; }
.heat i:nth-child(3) { animation-delay: 2s; }
@keyframes heatRise {
  from { bottom: 0; opacity: 0; transform: scaleX(.8); }
  40% { opacity: 1; }
  to { bottom: 100%; opacity: 0; transform: scaleX(1.1) skewX(10deg); }
}
.thermo { position: absolute; left: 8%; top: 12%; font-family: var(--emoji); font-size: 3.4rem; z-index: 3; animation: wobble 1.5s ease-in-out infinite; }

/* Bulutlar */
.cloud {
  position: absolute; width: 140px; height: 46px; border-radius: 50px; z-index: 2;
  background: #fff; opacity: .95;
  animation: drift var(--dur, 24s) ease-in-out infinite alternate;
}
.cloud::before, .cloud::after { content: ''; position: absolute; background: inherit; border-radius: 50%; }
.cloud::before { width: 60px; height: 60px; top: -30px; left: 20px; }
.cloud::after  { width: 80px; height: 80px; top: -44px; left: 52px; }
.cloud.grey  { background: #eef2f6; }
.cloud.dark  { background: #8592a3; }
.cloud.storm { background: #4b566a; }
@keyframes drift {
  from { transform: translateX(-40px) scale(var(--sc, 1)); }
  to   { transform: translateX(80px) scale(var(--sc, 1)); }
}

/* Yağmur, kar, rüzgar */
.drop {
  position: absolute; top: -12%; width: 3px; height: 24px; z-index: 3; border-radius: 3px;
  background: linear-gradient(transparent, rgba(225, 240, 255, .95));
  animation: fall var(--dur, .8s) linear infinite;
}
@keyframes fall { to { top: 110%; transform: translateX(-30px); } }
.flake {
  position: absolute; top: -10%; z-index: 3; color: #fff;
  text-shadow: 0 0 6px rgba(255, 255, 255, .9);
  animation: snow var(--dur, 6s) linear infinite;
}
@keyframes snow {
  50% { transform: translateX(30px) rotate(180deg); }
  to  { top: 110%; transform: translateX(-10px) rotate(360deg); }
}
.gust {
  position: absolute; left: -30%; height: 5px; width: 160px; z-index: 3; border-radius: 5px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent);
  animation: gust var(--dur, 2.4s) linear infinite;
}
@keyframes gust { to { left: 120%; } }
.leaf {
  position: absolute; left: -10%; z-index: 4; font-family: var(--emoji); font-size: 2rem;
  animation: leafFly var(--dur, 4s) linear infinite;
}
@keyframes leafFly {
  25% { transform: translateY(-30px) rotate(120deg); }
  50% { transform: translateY(20px) rotate(240deg); }
  75% { transform: translateY(-20px) rotate(300deg); }
  to  { left: 110%; transform: translateY(10px) rotate(420deg); }
}

/* Fırtına */
.flash { position: absolute; inset: 0; z-index: 6; background: #fff; opacity: 0; animation: flash 5s infinite; pointer-events: none; }
@keyframes flash { 0%, 88%, 100% { opacity: 0; } 90% { opacity: .85; } 92% { opacity: 0; } 94% { opacity: .55; } }
.bolt { position: absolute; top: 18%; left: 22%; z-index: 5; font-family: var(--emoji); font-size: 4rem; opacity: 0; animation: bolt 5s infinite; }
@keyframes bolt { 0%, 88%, 100% { opacity: 0; transform: scale(.6); } 90%, 95% { opacity: 1; transform: scale(1.15); } }

/* Gece */
.moon { position: absolute; top: 8%; right: 12%; font-family: var(--emoji); font-size: 5rem; z-index: 2; filter: drop-shadow(0 0 25px #fff6b0); animation: sunPulse 4s ease-in-out infinite; }
.star { position: absolute; z-index: 1; color: #fff8c8; animation: twinkle var(--dur, 2s) ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .2; transform: scale(.6); } }

/* Hayvan ve eşyalar */
.animal {
  position: absolute; left: 50%; bottom: 13%;
  transform: translateX(-50%);
  z-index: 5;
  font-family: var(--emoji);
  font-size: clamp(90px, 9vw, 175px);
  line-height: 1;
  text-align: center;
}
.animal .em { display: inline-block; filter: var(--tint, ) drop-shadow(0 8px 6px rgba(0, 0, 0, .2)); transform-origin: 50% 90%; }
/* Martı, güvercin ve karga için ayrı emoji olmadığından kuş emojisi renklendirilir */
.a-gull   { --tint: grayscale(1) brightness(2.1) contrast(.85); }
.a-pigeon { --tint: saturate(.2) brightness(.8) sepia(.15); }
.a-crow   { --tint: grayscale(1) brightness(.45) contrast(1.15); }
/* Martı sahnelerinde çimenin önünde deniz */
.sea {
  position: absolute; left: 0; right: 0; bottom: 30%; height: 14%; z-index: 0;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, .7) 0 9px, transparent 10px) 0 0 / 40px 18px repeat-x,
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, .35) 0 7px, transparent 8px) 20px 45% / 40px 14px repeat-x,
    linear-gradient(#5cc0f0, #2a86c9);
  animation: waves 3s linear infinite;
}
@keyframes waves { to { background-position: 40px 0, -20px 45%, 0 0; } }
.a-bee    { font-size: clamp(70px, 6.5vw, 120px); bottom: 34%; }
.animal .shadow {
  position: absolute; left: 50%; bottom: -8px; width: 70%; height: 18px; margin-left: -35%;
  border-radius: 50%; background: rgba(0, 0, 0, .18); z-index: -1;
}
.a-cat .em, .a-kitten .em { animation: breathe 2.6s ease-in-out infinite; }
.a-dog .em, .a-puppy .em  { animation: wag .6s ease-in-out infinite alternate; }
.a-bird .em, .a-chick .em { animation: hover 1.2s ease-in-out infinite; }
.a-duck .em, .a-hedgehog .em { animation: waddle 2.4s ease-in-out infinite; }
.a-bee .em    { animation: buzz 2.2s ease-in-out infinite; }
.a-gull .em   { animation: glide 3.2s ease-in-out infinite; }
.a-pigeon .em { animation: peck 1.4s ease-in-out infinite; }
.a-crow .em   { animation: crowHop 1.6s ease-in-out infinite; }
@keyframes buzz {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  12% { transform: translate(18px, -12px) rotate(8deg); }
  25% { transform: translate(40px, -28px) rotate(12deg); }
  37% { transform: translate(22px, -40px) rotate(4deg); }
  50% { transform: translate(0, -30px) rotate(-4deg); }
  62% { transform: translate(-22px, -40px) rotate(-10deg); }
  75% { transform: translate(-40px, -22px) rotate(-12deg); }
  87% { transform: translate(-18px, -8px) rotate(-5deg); }
}
@keyframes glide {
  0%, 100% { transform: translate(-25px, 0) rotate(-6deg); }
  50% { transform: translate(25px, -26px) rotate(6deg); }
}
@keyframes peck {
  0%, 40%, 100% { transform: rotate(0) translateY(0); }
  55% { transform: rotate(14deg) translateY(8px); }
  70% { transform: rotate(0) translateY(0); }
  80% { transform: rotate(10deg) translateY(5px); }
}
@keyframes crowHop {
  0%, 60%, 100% { transform: translateY(0) scale(1); }
  70% { transform: translateY(-26px) scale(1.04, .96); }
  80% { transform: translateY(0) scale(1.08, .92); }
}
@keyframes breathe { 50% { transform: scale(1.05, .97); } }
@keyframes wag { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes hover {
  0%, 100% { transform: translateY(0) scaleY(1); }
  25% { transform: translateY(-14px) scaleY(.92); }
  50% { transform: translateY(-22px) scaleY(1); }
}
@keyframes waddle {
  0%, 100% { transform: translateX(-18px) rotate(-3deg); }
  50% { transform: translateX(18px) rotate(3deg); }
}

.prop {
  position: absolute; z-index: 4;
  font-family: var(--emoji);
  font-size: clamp(42px, 4.2vw, 80px);
  animation: floaty 3s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .18));
}
@keyframes floaty { 50% { transform: translateY(-12px) rotate(4deg); } }

/* Doğru / yanlış tepkileri */
.scene.happy .animal .em { animation: hop .55s ease 3 !important; }
.scene.happy { animation: happyGlow 1.6s ease; }
@keyframes hop {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-70px) rotate(-10deg) scale(1.08); }
  60% { transform: translateY(0) scale(1.15, .85); }
}
@keyframes happyGlow {
  0%, 100% { box-shadow: var(--shadow); }
  40% { box-shadow: 0 0 0 10px rgba(34, 184, 102, .5), var(--shadow); }
}
.scene.sad .animal .em { animation: sadShake .7s ease !important; filter: var(--tint, ) saturate(.5) drop-shadow(0 8px 6px rgba(0, 0, 0, .2)); }
.scene.sad { animation: shake .5s; }
@keyframes sadShake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(4deg); }
}
.think {
  position: absolute; left: 58%; bottom: 52%; z-index: 7;
  font-family: var(--emoji); font-size: 3.4rem;
  background: #fff; border-radius: 50%; width: 1.6em; height: 1.6em;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  opacity: 0; transform: scale(0);
}
.scene.sad .think { animation: thinkPop 2.2s ease forwards; }
@keyframes thinkPop {
  0% { opacity: 0; transform: scale(0); }
  20%, 80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.6) translateY(-20px); }
}
.fx { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.fx span {
  position: absolute; left: 50%; top: 58%;
  font-family: var(--emoji); font-size: 2.6rem;
  animation: burst 1.4s ease-out forwards;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}
@keyframes burst {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(.3); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.3) rotate(var(--rot, 0deg)); }
}

/* ---------- Soru kartı ---------- */
.qcard {
  --cat: var(--purple);
  display: flex; flex-direction: column; gap: 1rem;
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.4rem 1.7rem;
  box-shadow: var(--shadow);
  border-top: 10px solid var(--cat);
}
.qcard.enter { animation: cardIn .65s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes cardIn {
  from { opacity: 0; transform: translateX(60px) rotate(1.5deg); }
  to   { opacity: 1; transform: none; }
}
.cat-label {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--cat); color: #fff;
  font-weight: 800; font-size: 1.35rem;
  padding: .25em 1em; border-radius: 999px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .15);
}
.cat-label small { font-size: .8em; opacity: .9; background: rgba(255, 255, 255, .25); padding: 0 .6em; border-radius: 999px; }
.story { font-size: 1.5rem; line-height: 1.5; margin: 0; font-weight: 600; }

.options { display: grid; gap: .85rem; }
.opt {
  display: flex; align-items: center; gap: 1rem;
  width: 100%;
  text-align: left;
  font-family: inherit; font-size: 1.35rem; font-weight: 700; color: var(--ink);
  min-height: 4.2rem;
  padding: .6em 1.1em;
  background: #f6f7ff;
  border: 4px solid #e3e6ff;
  border-radius: 22px;
  box-shadow: 0 6px 0 #d4d8f5;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .15s, border-color .2s, background .2s, opacity .3s, box-shadow .2s;
  animation: optIn .5s cubic-bezier(.2, .9, .3, 1.3) backwards;
  animation-delay: calc(var(--i, 0) * .12s + .25s);
}
.opt:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--purple); background: #f0edff; }
.opt:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #d4d8f5; }
.opt:disabled { cursor: default; }
.opt .letter {
  flex: none;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--purple); color: #fff; font-weight: 800;
  transition: background .2s;
}
@keyframes optIn {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to   { opacity: 1; transform: none; }
}
.opt.correct {
  background: var(--green-l); border-color: var(--green); box-shadow: 0 6px 0 var(--green-d);
  animation: correctPop .6s cubic-bezier(.2, .9, .3, 1.5);
}
.opt.correct .letter, .opt.reveal .letter { background: var(--green); }
.opt.wrong {
  background: var(--red-l); border-color: var(--red); box-shadow: 0 6px 0 var(--red-d);
  animation: shake .55s;
}
.opt.wrong .letter { background: var(--red); }
.opt.reveal { border-color: var(--green); border-style: dashed; background: #f0fff5; animation: revealGlow 1s ease 3; }
.opt.dim { opacity: .45; }
@keyframes correctPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); box-shadow: 0 6px 0 var(--green-d), 0 0 0 12px rgba(34, 184, 102, .25); }
  100% { transform: scale(1); }
}
@keyframes revealGlow { 50% { box-shadow: 0 6px 0 #d4d8f5, 0 0 0 10px rgba(34, 184, 102, .25); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-12px) rotate(-1deg); }
  30% { transform: translateX(10px) rotate(1deg); }
  45% { transform: translateX(-8px); }
  60% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}
@keyframes pop { 40% { transform: scale(1.15); } }

/* ---------- Geri bildirim ---------- */
.feedback {
  display: flex; align-items: center; flex-wrap: wrap; gap: 1rem;
  padding: 1rem 1.3rem;
  border-radius: 22px;
  animation: fbIn .5s cubic-bezier(.2, .9, .3, 1.3);
}
.feedback.good { background: var(--green-l); border-left: 12px solid var(--green); }
.feedback.bad  { background: var(--orange-l); border-left: 12px solid #ff9f1c; }
.fb-body { flex: 1 1 320px; }
.fb-title { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.feedback.good .fb-title { color: var(--green-d); }
.feedback.bad .fb-title { color: #c76a00; }
.fb-text { font-size: 1.2rem; margin: .3rem 0 0; line-height: 1.45; font-weight: 600; }
.btn-next { margin-left: auto; font-size: 1.5rem; background: var(--purple); box-shadow: 0 6px 0 var(--purple-d); animation: nextNudge 1.6s ease-in-out infinite 1s; }
@keyframes fbIn {
  from { opacity: 0; transform: translateY(24px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes nextNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(8px); } }

.float-score {
  position: fixed; z-index: 120; pointer-events: none;
  font-size: 3.2rem; font-weight: 800;
  text-shadow: 0 4px 0 rgba(0, 0, 0, .15);
  animation: floatUp 1.3s ease-out forwards;
}
.float-score.good { color: var(--green); }
.float-score.bad  { color: var(--red); }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.5); }
  20% { opacity: 1; transform: translate(-50%, -20px) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -110px) scale(1); }
}

/* ---------- Liderlik tablosu ---------- */
#board {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: var(--board-w);
  z-index: 60;
  display: flex; flex-direction: column;
  padding: 1.1rem 1rem;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(8px);
  box-shadow: -12px 0 32px rgba(0, 0, 0, .14);
  border-radius: 28px 0 0 28px;
  transform: translateX(105%);
  transition: transform .45s cubic-bezier(.2, .9, .3, 1);
}
body.board-open #board { transform: none; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.board-head h2 { margin: 0; font-size: 1.5rem; white-space: nowrap; }
.board-rules { margin: .3rem 0 .8rem; display: flex; gap: .5rem; font-weight: 700; font-size: 1rem; }
.board-rules span { padding: .1em .7em; border-radius: 999px; }
.board-rules .good { background: var(--green-l); color: var(--green-d); }
.board-rules .bad { background: var(--red-l); color: var(--red-d); }
.board-list { list-style: none; margin: 0; padding: 0 .2rem 0 0; overflow-y: auto; flex: 1; }
.board-list li {
  display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; align-items: center; gap: .5rem;
  padding: .45rem .7rem;
  margin-bottom: .5rem;
  border-radius: 18px;
  background: #f6f7ff;
  border: 3px solid transparent;
  font-size: 1.2rem; font-weight: 700;
}
.board-list li.current { border-color: var(--purple); background: #efeaff; }
.board-list li.done .bname::after { content: ' ✓'; color: var(--green); }
.board-list .rank { font-family: var(--font); font-weight: 800; text-align: center; color: var(--muted); font-size: 1.1rem; }
.board-list .rank.medal { font-family: var(--emoji); font-size: 1.6rem; }
/* Uzun isimler kesilmez, alt satıra geçer */
.board-list .bname { line-height: 1.15; overflow-wrap: anywhere; hyphens: auto; }
.board-list .bname small { display: block; white-space: nowrap; font-size: .75em; color: var(--purple); line-height: 1; }
.board-list .bscore {
  min-width: 3.2rem; text-align: center;
  background: #fff; border-radius: 999px; padding: .1em .6em;
  font-weight: 800; color: var(--purple);
}
.board-list li.bump .bscore { animation: scoreBump .8s ease; }
.board-list li.bump-bad .bscore { animation: scoreBumpBad .8s ease; }
.board-list .empty { display: block; text-align: center; color: var(--muted); background: none; font-weight: 600; }
@keyframes scoreBump { 30% { transform: scale(1.5); background: var(--green); color: #fff; } }
@keyframes scoreBumpBad { 30% { transform: scale(1.3); background: var(--red); color: #fff; } }

.board-foot { padding-top: .8rem; border-top: 3px dashed #eef0fa; text-align: center; }
.btn-danger { width: 100%; font-size: 1.1rem; background: var(--red); box-shadow: 0 6px 0 var(--red-d); }
.board-note { margin: .5rem 0 0; font-size: .9rem; color: var(--muted); font-weight: 600; }

#boardToggle {
  position: fixed; top: 50%; right: 0; z-index: 61;
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
  padding: .9rem .55rem;
  border: 0; cursor: pointer;
  border-radius: 22px 0 0 22px;
  background: var(--yellow);
  box-shadow: -4px 6px 16px rgba(0, 0, 0, .18);
  font-family: inherit; font-weight: 800; color: var(--ink);
  transition: right .45s cubic-bezier(.2, .9, .3, 1), background .2s, opacity .3s;
}
#boardToggle span { font-family: var(--emoji); font-size: 2rem; }
#boardToggle small { font-size: .95rem; }
#boardToggle:hover { background: #ffe066; }
body.board-open #boardToggle { right: var(--board-w); opacity: 0; pointer-events: none; }

/* ---------- Sıra ekranı ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(30, 20, 70, .55);
  backdrop-filter: blur(6px);
  animation: fadeIn .35s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.turn-card {
  background: #fff;
  border-radius: 40px;
  padding: 2rem 3rem 2.4rem;
  text-align: center;
  max-width: 92vw;
  border: 8px solid #fff3c4;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
  animation: zoomBounce .75s cubic-bezier(.2, .9, .3, 1.4);
}
@keyframes zoomBounce {
  from { opacity: 0; transform: scale(.4) rotate(-6deg); }
  to   { opacity: 1; transform: none; }
}
.turn-emoji { font-family: var(--emoji); font-size: 5.5rem; line-height: 1.1; animation: heroBounce 1.4s ease-in-out infinite; }
.turn-small { font-size: 1.6rem; font-weight: 700; color: var(--muted); }
.turn-name {
  font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 800; line-height: 1.05;
  overflow-wrap: anywhere;
  background: linear-gradient(90deg, var(--primary), #ff3d7f, var(--purple));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 0 .1em;
}
.turn-info { font-size: 1.3rem; color: var(--muted); margin: .2rem 0 1rem; font-weight: 600; }
.turn-stages { display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.6rem; }
.turn-stages span {
  background: var(--c); color: #fff; font-weight: 800; font-size: 1.25rem;
  padding: .3em 1em; border-radius: 999px;
  animation: optIn .5s backwards;
}
.turn-stages span:nth-child(2) { animation-delay: .15s; }
.turn-stages span:nth-child(3) { animation-delay: .3s; }

/* ---------- Bitiş ekranı ---------- */
.end-wrap { width: min(1400px, 100%); margin: 0 auto; text-align: center; }
.trophy { font-family: var(--emoji); font-size: 6rem; animation: trophy 2s ease-in-out infinite; display: inline-block; }
@keyframes trophy { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(8deg) scale(1.1); } }
.end-title {
  margin: 0; font-size: clamp(2.6rem, 5vw, 4.4rem); font-weight: 800; line-height: 1.1;
  background: linear-gradient(90deg, var(--primary), #ff3d7f, var(--purple));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.end-sub { font-size: 1.35rem; color: var(--muted); margin: .4rem auto 1.6rem; max-width: 900px; font-weight: 600; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.bcard {
  position: relative;
  background: #fff;
  border-radius: 28px;
  padding: 1.2rem 1rem 1.1rem;
  box-shadow: var(--shadow);
  border: 5px solid #eef0fa;
  animation: cardPop .7s cubic-bezier(.2, .9, .3, 1.4) backwards;
  animation-delay: calc(var(--i, 0) * .12s + .3s);
}
.bcard.top { border-color: #ffd23f; background: linear-gradient(#fffbea, #fff); }
.bcard .brank {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--purple); color: #fff; font-weight: 800;
  padding: .1em .9em; border-radius: 999px; font-size: 1.05rem; white-space: nowrap;
}
.bcard.top .brank { background: #f0a500; }
.b-emoji { font-family: var(--emoji); font-size: 3.8rem; line-height: 1.2; display: inline-block; animation: badgeSpin 1s ease backwards; animation-delay: calc(var(--i, 0) * .12s + .6s); }
@keyframes badgeSpin { from { transform: rotateY(360deg) scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
.b-name { font-size: 1.7rem; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.b-title { font-size: 1.3rem; font-weight: 800; color: var(--purple); margin-top: .2rem; }
.b-score { display: inline-block; margin: .4rem 0; font-weight: 800; background: #fff4d0; padding: .05em .8em; border-radius: 999px; }
.b-msg { margin: 0; font-size: 1.05rem; color: var(--muted); line-height: 1.35; font-weight: 600; }
@keyframes cardPop {
  from { opacity: 0; transform: translateY(40px) scale(.7); }
  to   { opacity: 1; transform: none; }
}
.end-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; margin: 2rem 0 .8rem; }
.end-author { color: var(--muted); font-size: 1.15rem; }

/* ---------- Konfeti ve alt bilgi ---------- */
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }
.author-footer {
  position: fixed; left: 14px; bottom: 10px; z-index: 40;
  background: rgba(255, 255, 255, .9);
  padding: .2em .9em; border-radius: 999px;
  font-weight: 700; font-size: .95rem; color: var(--ink);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .1);
}

@media (max-width: 700px) {
  #app { padding: 14px 16px 56px; }
  .setup-card { padding: 1.4rem 1rem; }
  .add-form { flex-direction: column; }
  .top-actions { margin-left: 0; }
  .turn-card { padding: 1.6rem 1.2rem 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
