/* SpeakRadar v2 — "gerçek ve samimi": Inter, sakin zemin, çizim karakterler başrolde */
:root {
  --bg: #F7F5F2;
  --surface: #FFFFFF;
  --line: #E9E5DF;
  --line-strong: #DDD8D0;
  --ink: #211E1B;
  --ink-soft: #79736B;
  --accent: #D95B43;        /* terracotta */
  --accent-deep: #C24A34;
  --teal: #2C7A6F;
  --amber: #DFA23C;
  --ok: #2C7A6F;
  --shadow-sm: 0 1px 2px rgba(33,30,27,.04), 0 4px 16px rgba(33,30,27,.06);
  --shadow-md: 0 8px 24px rgba(33,30,27,.10);
  --radius: 16px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
}

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

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.app { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 16px 22px 60px; }

.display { font-weight: 700; letter-spacing: -0.02em; }
h1.display { font-size: clamp(1.6rem, 3.4vw, 1.9rem); line-height: 1.2; }
.hl { color: var(--accent); }
.lede { color: var(--ink-soft); font-size: 1rem; max-width: 52ch; }

/* ------------------------------------------------ üst bar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 18px; }
.brand { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.brand-mark { display: flex; }
.brand-name { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand-name em { font-style: normal; color: var(--teal); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.chip {
  font-weight: 600; font-size: 0.82rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 13px; box-shadow: var(--shadow-sm); color: var(--ink);
}
.chip-level { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip-xp { color: var(--ink); }

.icon-btn {
  font-size: 1.05rem; line-height: 1; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  width: 40px; height: 40px; box-shadow: var(--shadow-sm); color: var(--ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ------------------------------------------------ kartlar & butonlar */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 24px;
}

.btn {
  font-family: var(--font); font-weight: 600; font-size: 0.95rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 20px;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-deep); }
.btn-ghost { background: var(--surface); }
.btn-small { font-size: 0.86rem; padding: 9px 15px; }
.btn:disabled { opacity: 0.55; cursor: wait; transform: none; }

.field-label { display: block; font-weight: 600; font-size: 0.92rem; margin: 16px 0 7px; }
input[type="text"], input[type="password"] {
  width: 100%; font-family: var(--font); font-size: 1rem;
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px;
  background: var(--surface); color: var(--ink);
}
input:focus { outline: 2px solid rgba(44, 122, 111, 0.35); border-color: var(--teal); }

/* ------------------------------------------------ Echo (koç modu: serbest sohbet, drill, karne) */
.parrot-slot { display: grid; place-items: center; }
.parrot { width: 100%; height: auto; overflow: visible; }
.parrot-slot-lg .parrot { width: 190px; }
.parrot-slot-md .parrot { width: 140px; }
.parrot-slot-chat .parrot { width: 130px; }
.drill-parrot .parrot { width: 96px; }

.parrot-root { transform-origin: 100px 140px; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.parrot .eyelid { transform-origin: 86px 66px; transform: scaleY(0); animation: blink 4.6s infinite; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(0); } 96%, 98% { transform: scaleY(1); } }
.parrot .beak-bottom { transform-origin: 112px 98px; }
.parrot-slot.speaking .beak-bottom { animation: flap 0.22s ease-in-out infinite; }
@keyframes flap { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(16deg); } }
.parrot .listen-rings { opacity: 0; }
.parrot-slot.listening .listen-rings circle { opacity: 1; animation: ring 1.4s ease-out infinite; transform-origin: 100px 110px; }
.parrot-slot.listening .listen-rings circle:nth-child(2) { animation-delay: 0.45s; }
@keyframes ring { 0% { opacity: 0.7; transform: scale(0.82); } 100% { opacity: 0; transform: scale(1.18); } }
.parrot-slot.listening .head { transform-origin: 96px 74px; animation: tilt 1.6s ease-in-out infinite; }
@keyframes tilt { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-7deg); } }
.parrot-slot.happy .parrot-root { animation: hop 0.5s ease-in-out 3; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-14px); } }
.parrot-slot.happy .wing { transform-origin: 132px 124px; animation: wingflap 0.5s ease-in-out 3; }
@keyframes wingflap { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-38deg); } }

/* ------------------------------------------------ ekran geçişi */
.screen { animation: screenIn 0.35s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* giriş / kayıt */
.auth-wrap { display: grid; gap: 16px; justify-items: center; max-width: 400px; margin: 24px auto 0; }
.auth-card { width: 100%; display: grid; gap: 12px; text-align: center; }
.auth-card h1.display { font-size: 1.6rem; }
.auth-sub { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 2px; }
.auth-tabs { display: flex; gap: 8px; }
.auth-tab { flex: 1; padding: 9px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-weight: 600; cursor: pointer; font-family: var(--font); color: var(--ink); }
.auth-tab.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.auth-card input { text-align: left; }
.auth-hint { color: var(--ink-soft); font-size: 0.78rem; }
.screen-auth #auth-go { width: 100%; }

/* kurulum */
.screen-setup { display: grid; gap: 26px; max-width: 620px; margin: 16px auto 0; text-align: center; }
.setup-hero { display: grid; gap: 10px; justify-items: center; }
.setup-card { text-align: left; }
.setup-card h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 10px; }
.setup-steps { margin: 8px 0 16px 20px; line-height: 1.9; }
.setup-steps a { color: var(--teal); font-weight: 600; }
.setup-row { display: flex; gap: 10px; }
.setup-row input { flex: 1; }
.setup-error { color: var(--accent-deep); font-weight: 600; margin-top: 10px; font-size: 0.92rem; }
.setup-alt { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); color: var(--ink-soft); flex-wrap: wrap; font-size: 0.92rem; }

/* onboarding */
.onboard-wrap { display: grid; gap: 18px; justify-items: center; max-width: 600px; margin: 20px auto 0; }
.onboard-card { width: 100%; }
.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.level-btn {
  display: grid; gap: 3px; justify-items: center; padding: 14px 8px; cursor: pointer;
  font-family: var(--font); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.level-btn b { font-size: 1.15rem; font-weight: 700; }
.level-btn span { font-size: 0.78rem; color: var(--ink-soft); text-align: center; line-height: 1.3; }
.level-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.level-btn-test { background: var(--teal); border-color: var(--teal); }
.level-btn-test span, .level-btn-test b { color: #fff; }

/* ------------------------------------------------ ana sayfa */
.home-hero { display: flex; align-items: center; gap: 24px; margin: 4px 0 26px; flex-wrap: wrap; }
.home-hello { display: grid; gap: 6px; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mode-card {
  display: grid; gap: 7px; text-align: left; cursor: pointer; align-content: start;
  font-family: var(--font); color: var(--ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.mode-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mode-emoji { font-size: 1.6rem; }
.mode-title { font-weight: 700; font-size: 1.06rem; letter-spacing: -0.01em; }
.mode-sub { color: var(--ink-soft); font-size: 0.9rem; }
.mode-roleplay-head { grid-row: span 2; cursor: default; }
.mode-roleplay-head:hover { transform: none; box-shadow: var(--shadow-sm); }

.scenario-row { display: grid; gap: 12px; margin-top: 12px; }
.scenario-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; box-shadow: var(--shadow-sm); font-family: var(--font);
}
.scenario-emoji { font-size: 1.4rem; }
.scenario-txt { display: grid; gap: 2px; flex: 1; cursor: pointer; }
.scenario-title { font-weight: 700; font-size: 0.98rem; color: var(--ink); letter-spacing: -0.01em; }
.scenario-sub { font-size: 0.8rem; color: var(--ink-soft); }
.scenario-best { font-weight: 700; font-size: 0.78rem; color: var(--amber); white-space: nowrap; }
/* karakter seçimi: iki avatar */
.scen-chars { display: flex; gap: 6px; }
.scen-char {
  width: 46px; height: 46px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface); overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s;
}
.scen-char img { width: 100%; height: 100%; display: block; }
.scen-char:hover { transform: scale(1.1); border-color: var(--accent); }
.scen-char.active { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(44,122,111,.25); }

/* ------------------------------------------------ sohbet */
.screen-chat { display: grid; gap: 12px; }
.chat-head { display: flex; align-items: center; gap: 14px; }
.chat-title-wrap { display: grid; flex: 1; }
.chat-title { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.chat-status { font-size: 0.84rem; color: var(--ink-soft); min-height: 1.2em; }
.btn-endlesson { background: var(--surface); }

.chat-body { display: grid; grid-template-columns: 210px 1fr; gap: 18px; align-items: start; }
.chat-side { display: grid; gap: 12px; position: sticky; top: 12px; }

/* karakter paneli (rol oyunu) */
.char-panel { padding: 16px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.char-img { width: 108px; height: 108px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 2px 10px rgba(33,30,27,.16); }
.char-meta { display: grid; gap: 2px; }
.char-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.char-role { font-size: 0.78rem; color: var(--ink-soft); }
.char-call { font-size: 0.72rem; color: var(--teal); font-weight: 600; letter-spacing: 0.04em; }
.char-panel.speaking .char-img { animation: charPulse 1.2s ease-in-out infinite; }
@keyframes charPulse {
  0%, 100% { box-shadow: 0 2px 10px rgba(33,30,27,.16), 0 0 0 0 rgba(44,122,111,.35); }
  50% { box-shadow: 0 2px 10px rgba(33,30,27,.16), 0 0 0 10px rgba(44,122,111,0); }
}

.goals-panel, .vocab-panel { padding: 15px; }
.goals-panel h3, .vocab-panel h3 { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 9px; }
#goals-list, #vocab-list { list-style: none; display: grid; gap: 7px; }
#goals-list li { font-size: 0.86rem; display: flex; gap: 7px; align-items: baseline; color: var(--ink-soft); }
#goals-list li.done { color: var(--ok); font-weight: 600; text-decoration: line-through; }
#goals-list li::before { content: "○"; font-weight: 700; }
#goals-list li.done::before { content: "✓"; }
#vocab-list li { font-size: 0.84rem; color: var(--ink-soft); }
#vocab-list b { color: var(--teal); font-weight: 600; }

.chat-main { display: grid; gap: 10px; }
.chat-feed {
  display: flex; flex-direction: column; gap: 12px;
  min-height: 340px; max-height: 54vh; overflow-y: auto;
  padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  scroll-behavior: smooth;
}
/* senaryo sahnesi: soluk çizim fon + okunabilirlik örtüsü */
.chat-feed.scened { border: none; background-size: cover; background-position: center; }
.chat-feed.scene-restaurant { background-image: linear-gradient(rgba(247,245,242,.78), rgba(247,245,242,.86)), url('/img/scene-restaurant.svg'); }
.chat-feed.scene-fair { background-image: linear-gradient(rgba(247,245,242,.78), rgba(247,245,242,.86)), url('/img/scene-fair.svg'); }
.chat-feed.scene-directions { background-image: linear-gradient(rgba(247,245,242,.78), rgba(247,245,242,.86)), url('/img/scene-directions.svg'); }

.bubble {
  max-width: 78%; padding: 12px 16px;
  font-size: 1rem; line-height: 1.5; animation: bubbleIn 0.3s ease;
  white-space: pre-wrap;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bubble-echo {
  align-self: flex-start; background: rgba(255,255,255,.96); color: var(--ink);
  border-radius: 18px 18px 18px 4px; box-shadow: 0 2px 10px rgba(33,30,27,.10);
}
.bubble-user { align-self: flex-end; background: var(--accent); color: #fff; border-radius: 18px 18px 4px 18px; box-shadow: 0 2px 10px rgba(217,91,67,.25); }
.bubble-tr { display: block; color: var(--ink-soft); font-size: 0.86rem; font-style: italic; margin-top: 6px; }
.bubble-echo .speak-again { margin-left: 8px; cursor: pointer; border: none; background: none; font-size: 0.95rem; }

/* AI mesaj satırı: karakter mini avatarı */
.echo-row { display: flex; gap: 8px; align-items: flex-end; max-width: 84%; align-self: flex-start; }
.echo-row .bubble { max-width: 100%; align-self: auto; }
.echo-row-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; box-shadow: 0 1px 5px rgba(33,30,27,.2); }

/* tıklanabilir cümleler → Türkçe çeviri */
.say-sent { cursor: pointer; border-radius: 5px; padding: 0 2px; border-bottom: 1.5px dotted rgba(44,122,111,.5); transition: background 0.12s ease; }
.say-sent:hover { background: rgba(44,122,111,.1); }
.say-sent.open { background: rgba(44,122,111,.14); border-bottom-style: solid; }
.sent-tr {
  display: block; margin: 5px 0 7px; padding: 6px 10px;
  background: var(--bg); border-left: 3px solid var(--teal); border-radius: 0 8px 8px 0;
  color: var(--ink-soft); font-size: 0.86rem; font-style: italic;
  animation: bubbleIn 0.25s ease;
}
.sent-tr-speak { border: none; background: none; cursor: pointer; font-size: 0.9rem; margin-left: 6px; }

/* kelime kelime sözlük */
.gloss-wrap { display: block; margin-top: 4px; }
.gloss-toggle {
  border: none; background: none; cursor: pointer;
  font-family: var(--font); font-size: 0.78rem; font-weight: 600; color: var(--teal);
  padding: 2px 0;
}
.gloss-toggle:hover { text-decoration: underline; }
.gloss-list { display: grid; gap: 3px; margin-top: 5px; padding: 8px 10px; background: rgba(44,122,111,.05); border-radius: 8px; }
.gloss-row { display: flex; gap: 10px; align-items: center; font-size: 0.84rem; font-style: normal; }
.gloss-row .gw { font-weight: 600; color: var(--ink); cursor: pointer; min-width: 90px; }
.gloss-row .gw:hover { color: var(--teal); }
.gloss-row .gt { color: var(--ink-soft); font-style: italic; flex: 1; }
.gloss-video { padding: 2px 8px; font-size: 0.72rem; }
.gloss-loading { font-size: 0.8rem; color: var(--ink-soft); font-style: italic; }

.correction-card {
  align-self: center; width: min(92%, 460px);
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 10px 14px; font-size: 0.9rem; animation: bubbleIn 0.3s ease;
  box-shadow: var(--shadow-sm);
}
.correction-card .cx-wrong { text-decoration: line-through; color: var(--accent-deep); font-weight: 600; }
.correction-card .cx-right { color: var(--ok); font-weight: 700; }
.correction-card .cx-note { display: block; color: var(--ink-soft); font-size: 0.83rem; margin-top: 3px; }

.typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 14px 18px; background: rgba(255,255,255,.96); border-radius: 18px 18px 18px 4px; box-shadow: 0 2px 10px rgba(33,30,27,.1); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); animation: tdot 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.18s; }
.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes tdot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* cevap kartları */
.answer-chips { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: 90%; animation: bubbleIn 0.3s ease; }
.answer-chips-label { width: 100%; font-size: 0.76rem; color: var(--ink-soft); font-weight: 600; letter-spacing: 0.03em; }
.answer-chip {
  display: grid; gap: 1px; text-align: left; cursor: pointer;
  font-family: var(--font); background: var(--surface);
  border: 1.5px dashed var(--teal); border-radius: 12px; padding: 8px 12px;
  transition: transform 0.14s ease, background 0.14s; box-shadow: var(--shadow-sm);
}
.answer-chip b { font-size: 0.92rem; color: var(--ink); font-weight: 600; }
.answer-chip span { font-size: 0.73rem; color: var(--ink-soft); font-style: italic; }
.answer-chip:hover { transform: translateY(-1px); background: rgba(44,122,111,.06); border-style: solid; }

/* alt kontrol dock'u */
.chat-controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(255,255,255,.88); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.lang-toggle {
  font-family: var(--font); font-weight: 600; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 9px 14px; box-shadow: var(--shadow-sm); font-size: 0.84rem;
}
.mic-btn {
  width: 64px; height: 64px; border-radius: 50%; cursor: pointer;
  background: var(--accent); color: #fff;
  border: none; box-shadow: 0 4px 16px rgba(217,91,67,.4);
  display: grid; place-items: center; touch-action: none; user-select: none;
  transition: transform 0.14s ease, background 0.2s;
  position: relative;
}
.mic-btn:hover { transform: translateY(-2px); }
.mic-btn.recording { background: var(--accent-deep); transform: scale(1.06); animation: micPulse 1.2s infinite; }
@keyframes micPulse {
  0% { box-shadow: 0 4px 16px rgba(217,91,67,.4), 0 0 0 0 rgba(217,91,67,.3); }
  100% { box-shadow: 0 4px 16px rgba(217,91,67,.4), 0 0 0 16px rgba(217,91,67,0); }
}
/* AI konuşurken: mikrofon "durdur"a dönüşür */
.mic-btn.tts-on { background: var(--ink); box-shadow: 0 4px 16px rgba(33,30,27,.35); }
.mic-btn.tts-on svg { display: none; }
.mic-btn.tts-on::after { content: ""; width: 20px; height: 20px; border-radius: 4px; background: #fff; }
.mic-btn.disabled { background: #C9C3BA; cursor: not-allowed; }

.text-fallback { display: flex; gap: 8px; flex: 1; min-width: 200px; }
.text-fallback input { flex: 1; }
.mic-hint { font-size: 0.8rem; color: var(--ink-soft); }

/* ------------------------------------------------ karne */
.report-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.report-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.report-card h3 { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 12px; }
.report-card-wide { grid-column: 1 / -1; }
.report-list { display: grid; gap: 10px; max-height: 340px; overflow-y: auto; }
.report-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 0.9rem; }
.report-item .ri-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.report-item .ri-date { color: var(--ink-soft); font-weight: 400; font-size: 0.78rem; white-space: nowrap; }
.report-item .ri-sub { color: var(--ink-soft); margin-top: 3px; font-size: 0.86rem; }
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.vocab-chip { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 0.88rem; }
.vocab-chip b { display: block; color: var(--teal); font-weight: 600; }
.empty-note { color: var(--ink-soft); font-style: italic; font-size: 0.9rem; }

/* ------------------------------------------------ overlay'ler */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(24, 21, 18, 0.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.overlay[hidden] { display: none; }
.overlay .card { animation: cardPop 0.3s ease; border-radius: 20px; }
@keyframes cardPop { from { opacity: 0; transform: scale(0.92) translateY(14px); } to { opacity: 1; transform: none; } }

.drill-card { width: min(560px, 94vw); text-align: center; display: grid; gap: 12px; justify-items: center; }
.drill-kicker { font-weight: 600; color: var(--accent-deep); font-size: 0.92rem; }
.drill-phrase { font-size: clamp(1.5rem, 4.4vw, 2.1rem); font-weight: 700; letter-spacing: -0.02em; background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 14px; padding: 10px 26px; }
.drill-tip { color: var(--ink-soft); font-size: 0.92rem; max-width: 42ch; }
.drill-dots { display: flex; gap: 10px; }
.drill-dots span { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); }
.drill-dots span.used { background: var(--accent); border-color: var(--accent); }
.drill-dots span.won { background: var(--ok); border-color: var(--ok); }
.drill-meter { width: min(320px, 80%); height: 14px; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: var(--surface); }
.drill-meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--amber), var(--ok)); transition: width 0.6s ease; }
.drill-result { font-weight: 600; min-height: 1.4em; font-size: 0.95rem; }
.drill-result.good { color: var(--ok); }
.drill-result.bad { color: var(--accent-deep); }
.drill-actions { display: grid; gap: 12px; justify-items: center; width: 100%; }
.mic-btn-drill { width: 60px; height: 60px; }

/* kelime videosu */
.video-card { width: min(720px, 94vw); display: grid; gap: 14px; justify-items: center; }
.video-title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.video-card video { width: 100%; max-height: 62vh; border: 1px solid var(--line); border-radius: 14px; background: #000; }
.video-btn {
  font-family: var(--font); font-weight: 600; font-size: 0.8rem; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 5px 12px; box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease;
}
.video-btn:hover { transform: translateY(-1px); border-color: var(--amber); }
.drill-videos, .cx-videos { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cx-videos { justify-content: flex-start; margin-top: 7px; }

.summary-card { width: min(560px, 94vw); max-height: 88vh; overflow-y: auto; text-align: center; display: grid; gap: 12px; justify-items: center; }
.summary-card h2 { font-size: 1.4rem; }
.summary-score { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--teal); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 6px 28px; }
.summary-praise { font-weight: 600; color: var(--ok); }
.summary-text { color: var(--ink); }
.summary-talk { font-weight: 700; color: var(--teal); }
.summary-corrections { width: 100%; display: grid; gap: 8px; justify-items: stretch; text-align: left; }
.summary-cx-head { font-weight: 700; font-size: 0.92rem; }
.summary-corrections .correction-card { width: auto; align-self: stretch; }
.summary-focus { color: var(--ink-soft); font-size: 0.92rem; }
.summary-xp { font-weight: 700; color: var(--amber); font-size: 1.05rem; }

.settings-card { width: min(480px, 94vw); display: grid; gap: 4px; }
.settings-card h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.settings-levels { display: flex; gap: 8px; margin: 4px 0 14px; }
.settings-levels button {
  flex: 1; font-family: var(--font); font-weight: 600; font-size: 0.92rem; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 0; background: var(--surface);
  box-shadow: var(--shadow-sm); color: var(--ink);
}
.settings-levels button.active { background: var(--teal); border-color: var(--teal); color: #fff; }
#btn-settings-close { margin-top: 8px; }

/* ------------------------------------------------ günlük paket */
.daily-card { display: grid; gap: 12px; margin-bottom: 18px; padding: 18px 22px; }
.daily-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.daily-title { font-weight: 700; letter-spacing: -0.01em; }
.daily-streak { font-weight: 700; font-size: 0.86rem; color: var(--accent-deep); }
.chip-streak { background: #FFF1E8; border-color: #F3CBB8; color: var(--accent-deep); }
.daily-tasks { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-soft); }
.daily-tasks .done { color: var(--ok); font-weight: 600; }
.daily-bonus { margin-left: auto; font-size: 0.8rem; color: var(--amber); font-weight: 700; }
.daily-phrases { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.daily-phrase {
  display: flex; gap: 10px; align-items: center; text-align: left; cursor: pointer;
  font-family: var(--font); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px;
  transition: transform 0.14s ease, border-color 0.14s;
}
.daily-phrase:hover { transform: translateY(-1px); border-color: var(--teal); }
.dp-play { font-size: 1rem; }
.dp-txt { display: grid; }
.dp-txt b { font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.dp-txt span { font-size: 0.74rem; color: var(--ink-soft); font-style: italic; }

/* ------------------------------------------------ konuşma trendi */
.trend-card { display: flex; align-items: flex-end; gap: 14px; padding: 14px 20px; margin-bottom: 18px; overflow-x: auto; }
.trend-title { font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); letter-spacing: 0.04em; text-transform: uppercase; align-self: center; min-width: 90px; }
.trend-col { display: grid; justify-items: center; gap: 3px; }
.trend-col i { display: block; width: 22px; border-radius: 6px 6px 2px 2px; background: var(--line); }
.trend-col i.has { background: var(--teal); }
.trend-col b { font-size: 0.68rem; font-weight: 600; color: var(--ink-soft); }
.trend-col em { font-size: 0.64rem; font-style: normal; color: var(--teal); min-height: 0.9em; }

/* ------------------------------------------------ seviye grupları (rol oyunları) */
.level-group { margin-top: 14px; }
.level-group-head { display: flex; align-items: center; gap: 8px; margin: 4px 2px 8px; }
.level-badge { font-weight: 700; font-size: 0.78rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--ink-soft); }
.level-badge.here { background: var(--teal); border-color: var(--teal); color: #fff; }
.level-group-title { font-size: 0.82rem; color: var(--ink-soft); font-weight: 600; }
.level-group.dim .scenario-card { opacity: 0.72; }

/* kalıp pratiği ekranı */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 16px; }
.cat-card {
  display: grid; gap: 6px; text-align: left; cursor: pointer; align-content: start;
  font-family: var(--font); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cat-emoji { font-size: 1.5rem; }
.cat-title { font-weight: 700; letter-spacing: -0.01em; }
.cat-count { font-size: 0.8rem; color: var(--ink-soft); }

/* hızlı tekrar overlay */
.review-card { width: min(520px, 94vw); text-align: center; display: grid; gap: 12px; justify-items: center; max-height: 88vh; overflow-y: auto; }
.review-parrot .parrot { width: 92px; }
.review-card h2 { font-size: 1.3rem; }
.review-sub { color: var(--ink-soft); font-size: 0.92rem; }
.review-list { width: 100%; display: grid; gap: 8px; }
.review-phrase {
  display: flex; gap: 10px; align-items: center; text-align: left; cursor: pointer;
  font-family: var(--font); background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  transition: transform 0.14s ease, border-color 0.14s;
}
.review-phrase:hover { transform: translateY(-1px); border-color: var(--teal); }
.review-phrase b { font-size: 0.92rem; font-weight: 600; }
.review-phrase span { font-size: 0.78rem; color: var(--ink-soft); font-style: italic; }
.review-phrase .rp-txt { display: grid; }

/* kalıp oynatıcı overlay */
.player-card { width: min(520px, 94vw); text-align: center; display: grid; gap: 14px; justify-items: center; }
.player-progress { width: 100%; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.player-progress-fill { height: 100%; width: 0; background: var(--teal); transition: width 0.3s ease; }
.player-count { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; }
.player-en { font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 700; letter-spacing: -0.02em; }
.player-tr { color: var(--ink-soft); font-style: italic; }
.player-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.player-result { font-weight: 600; min-height: 1.2em; font-size: 0.9rem; }
.player-result.good { color: var(--ok); }
.player-nav { display: flex; gap: 10px; }

/* ------------------------------------------------ sıralama */
.lb-list { display: grid; gap: 8px; margin-top: 14px; }
.lb-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow-sm); }
.lb-row.me { border-color: var(--teal); background: rgba(44,122,111,.06); }
.lb-rank { font-weight: 700; font-size: 1.05rem; min-width: 40px; }
.lb-name { flex: 1; font-weight: 600; }
.lb-name .lb-lvl { font-size: 0.72rem; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.lb-streak { color: var(--accent-deep); font-weight: 600; font-size: 0.85rem; }
.lb-xp { font-weight: 700; color: var(--amber); font-variant-numeric: tabular-nums; }
.mode-leaderboard { background: linear-gradient(135deg, var(--surface) 60%, rgba(223,162,60,.12)); }

/* ------------------------------------------------ admin paneli */
.admin-list { display: grid; gap: 12px; margin-top: 14px; }
.admin-user { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-sm); display: grid; gap: 8px; }
.admin-user.off { opacity: 0.6; }
.au-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.au-name { font-weight: 700; }
.au-badges { display: flex; gap: 6px; }
.au-badge { font-size: 0.7rem; font-weight: 600; border-radius: 999px; padding: 2px 8px; }
.au-badge.admin { background: var(--teal); color: #fff; }
.au-badge.off { background: #E9E5DF; color: var(--ink-soft); }
.au-stats { font-size: 0.82rem; color: var(--ink-soft); }
.au-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.au-danger { border-color: var(--accent); color: var(--accent-deep); }
.settings-acct { font-weight: 600; color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 6px; }
.admin-tag { font-size: 0.66rem; font-weight: 600; background: var(--teal); color: #fff; border-radius: 999px; padding: 1px 7px; vertical-align: middle; }
.settings-actions { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.signup-note { font-size: 0.8rem; color: var(--ink-soft); margin: 2px 0 6px; }

/* ------------------------------------------------ mobil alt menü */
.tabbar { display: none; }
@media (max-width: 820px) {
  .tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: rgba(255,255,255,.94); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .tab-btn {
    display: grid; gap: 2px; justify-items: center; cursor: pointer;
    background: none; border: none; padding: 4px 0;
    font-family: var(--font); font-size: 0.66rem; font-weight: 600; color: var(--ink-soft);
  }
  .tab-btn .tab-ico { font-size: 1.15rem; filter: grayscale(0.4); opacity: 0.7; }
  .tab-btn.active { color: var(--teal); }
  .tab-btn.active .tab-ico { filter: none; opacity: 1; }
  .app { padding-bottom: 78px; }
  .topbar .brand-name { font-size: 1.05rem; }
}

/* ------------------------------------------------ konfeti */
#confetti-root { position: fixed; inset: 0; pointer-events: none; z-index: 99; overflow: hidden; }
.confetti-piece { position: absolute; top: -20px; width: 10px; height: 10px; animation: confall linear forwards; }
@keyframes confall { to { transform: translateY(110vh) rotate(720deg); opacity: 0.7; } }

/* ------------------------------------------------ duyarlılık */
@media (max-width: 820px) {
  .chat-body { grid-template-columns: 1fr; }
  .chat-side { position: static; grid-template-columns: 1fr 1fr; align-items: start; }
  .char-panel { grid-column: 1 / -1; grid-template-columns: auto 1fr; text-align: left; justify-items: start; }
  .char-img { width: 72px; height: 72px; }
  .mode-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .level-grid { grid-template-columns: repeat(2, 1fr); }
  .home-hero { justify-content: center; text-align: center; }
}
@media (max-width: 540px) {
  .app { padding: 12px 12px 84px; }
  .chat-side { grid-template-columns: 1fr; }
  .parrot-slot-chat .parrot { width: 100px; }
  .bubble { max-width: 92%; }
}
