/* ══════════════════════════════════════════════════════════════════════════
   style.css  —  Adaptif Osmanlı Türkçesi Okuma Platformu
   Tasarım: Akademik minimalizm | RTL Osmanlıca tipografi | Mobile-first
   Renk Paleti: Koyu ceviz #042C53 | Altın #185FA5 | Krem #F7FAFD
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Google Fonts ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Lateef&family=Noto+Serif:ital,wght@0,400;0,600;1,400&display=swap');

/* ── Design Tokens ────────────────────────────────────────────────────── */
:root {
  --walnut:        #042C53;
  --walnut-light:  #0C447C;
  --gold:          #185FA5;
  --gold-light:    #9CC6EE;
  --gold-dim:      rgba(24,95,165,.15);
  --cream:         #F7FAFD;
  --cream-dark:    #EFF5FB;
  --text-primary:  #1B2A4A;
  --text-muted:    #5A6C86;
  --text-light:    #8FA6BF;
  --success:       #2E7D55;
  --success-bg:    #E8F5EE;
  --warn:          #B85C00;
  --warn-bg:       #FFF3E0;
  --error:         #C0392B;
  --error-bg:      #FDECEA;
  --border:        rgba(4,44,83,.15);
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     10px;
  --shadow-sm:     0 2px 8px rgba(4,44,83,.10);
  --shadow-md:     0 6px 24px rgba(4,44,83,.14);
  --shadow-lg:     0 16px 48px rgba(4,44,83,.18);
  --transition:    .2s cubic-bezier(.4,0,.2,1);
  --font-ar:       'Amiri', 'Lateef', serif;
  --font-ui:       Georgia, 'Palatino Linotype', 'Times New Roman', serif;
}

/* ── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--cream);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.7;
}

/* ── Utility ──────────────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.sr-only  { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* ══════════════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════════════ */
.site-header {
  background: var(--walnut);
  color: var(--cream);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.site-header .logo {
  font-family: var(--font-ar);
  font-size: 1.6rem;
  color: var(--gold);
  letter-spacing: .02em;
  flex: 1;
}

.site-header .subtitle {
  font-size: .75rem;
  color: rgba(250,247,242,.6);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Progress bar */
.global-progress {
  background: rgba(255,255,255,.1);
  border-radius: 99px;
  height: 4px;
  width: 120px;
  overflow: hidden;
}
.global-progress-fill {
  height: 100%;
  background: var(--gold);
  transition: width .5s ease;
  border-radius: 99px;
}

/* ══════════════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ══════════════════════════════════════════════════════════════════════ */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ══════════════════════════════════════════════════════════════════════
   SCREEN CARDS  (each view = a .screen-card)
   ══════════════════════════════════════════════════════════════════════ */
.screen-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  animation: fadeUp .35s ease both;
}

@keyframes fadeUp {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── Section Heading ──────────────────────────────────────────────── */
.screen-card h2 {
  font-family: var(--font-ui);
  font-size: 1.35rem;
  color: var(--walnut);
  font-weight: 600;
  margin-bottom: .4rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.screen-card h2 .badge {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .25em .7em;
  border-radius: 99px;
  background: var(--gold-dim);
  color: var(--walnut);
}

.screen-card .desc {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 1.8rem;
  line-height: 1.6;
  border-left: 3px solid var(--gold);
  padding-left: .9rem;
}

/* ══════════════════════════════════════════════════════════════════════
   CONSENT / GIRIŞ EKRANI
   ══════════════════════════════════════════════════════════════════════ */
#consent-screen { text-align: center; }

#consent-screen .header-ornament {
  font-family: var(--font-ar);
  font-size: 2.8rem;
  color: var(--gold);
  display: block;
  margin-bottom: .5rem;
}

#consent-screen h1 {
  font-size: 1.5rem;
  color: var(--walnut);
  margin-bottom: .4rem;
}

#consent-screen .institution {
  font-size: .82rem;
  color: var(--text-light);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.form-group {
  text-align: left;
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .35rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.form-group input[type="text"] {
  width: 100%;
  padding: .7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: .95rem;
  background: var(--cream);
  color: var(--text-primary);
  transition: border-color var(--transition);
}
.form-group input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.league-optin-box {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream);
  padding: .8rem .9rem;
}

.league-optin-box input[type="text"] {
  width: 100%;
  padding: .68rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: .92rem;
  background: #fff;
}

.league-optin-box input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.champions-league {
  border: 1px solid rgba(24,95,165,.35);
  background: linear-gradient(180deg, rgba(24,95,165,.08) 0%, rgba(255,255,255,.96) 100%);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.4rem;
  text-align: left;
}

.league-head h3 {
  font-size: 1.05rem;
  color: var(--walnut);
  margin-bottom: .2rem;
}

.league-head p {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .8rem;
}

.league-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .8rem;
}

.league-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem .9rem;
}

.league-card h4 {
  font-size: .86rem;
  color: var(--walnut);
  margin-bottom: .55rem;
}

.league-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: 0;
  margin: 0;
}

.league-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  font-size: .82rem;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .42rem .6rem;
}

.league-rank {
  min-width: 2.1rem;
  font-weight: 700;
  color: var(--walnut);
}

.league-rank.gold { color: #185FA5; }
.league-rank.silver { color: #5A6C86; }
.league-rank.bronze { color: #0C447C; }

.league-name {
  flex: 1;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-score {
  font-weight: 700;
  color: var(--gold);
  font-size: .8rem;
}

.certificate-panel {
  margin-top: 1.3rem;
  border: 1px solid rgba(24,95,165,.35);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(24,95,165,.07) 0%, rgba(255,255,255,1) 100%);
  padding: 1rem 1.1rem;
}

.certificate-panel h3 {
  font-size: 1rem;
  color: var(--walnut);
  margin-bottom: .4rem;
}

.certificate-panel p {
  font-size: .85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: .8rem;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  background: var(--cream-dark);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  cursor: pointer;
  font-size: .88rem;
  color: var(--text-primary);
  line-height: 1.5;
  text-align: left;
  transition: border-color var(--transition);
}
.consent-label:hover { border-color: var(--gold); }
.consent-label input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--walnut);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 2rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--walnut);
  color: var(--cream);
}
.btn-primary:hover:not(:disabled) {
  background: var(--walnut-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.btn-gold {
  background: var(--gold);
  color: var(--walnut);
}
.btn-gold:hover:not(:disabled) {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover {
  border-color: var(--walnut);
  background: var(--cream-dark);
}

.btn-full { width: 100%; }

/* ══════════════════════════════════════════════════════════════════════
   AŞAMA GÖSTERGESI (step indicator)
   ══════════════════════════════════════════════════════════════════════ */
.phase-bar {
  display: flex;
  gap: .5rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.phase-step {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: var(--text-light);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.phase-step .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--cream-dark);
  border: 2px solid var(--border);
  transition: all var(--transition);
}
.phase-step.active   { color: var(--walnut); }
.phase-step.active   .dot { background: var(--gold); border-color: var(--gold); }
.phase-step.done     { color: var(--success); }
.phase-step.done     .dot { background: var(--success); border-color: var(--success); }
.phase-sep { flex: 1; height: 1px; background: var(--border); min-width: 20px; }

/* ══════════════════════════════════════════════════════════════════════
   ÖN TEST — CÜMLE GÖRÜNÜMÜ
   ══════════════════════════════════════════════════════════════════════ */
.pretest-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.2rem;
}

/* Cümle bloğu */
.pretest-sentence {
  direction: rtl;
  unicode-bidi: embed;
  font-family: var(--font-ar);
  font-size: 2rem;
  line-height: 2.4;
  text-align: right;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  row-gap: .1rem;
  margin-bottom: .5rem;
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  border: 1px solid var(--border);
}

/* Tıklanabilir kelime — renk yok (ipucu vermez) */
.pretest-token {
  cursor: pointer;
  padding: .1em .3em;
  border-radius: 5px;
  border-bottom: 2px solid var(--border);
  color: var(--walnut);
  transition: background var(--transition), border-color var(--transition);
  position: relative;
}
.pretest-token:hover {
  background: var(--gold-dim);
  border-bottom-color: var(--gold);
}
.pretest-token.active {
  background: var(--gold-dim);
  border-bottom-color: var(--gold);
  color: var(--walnut);
}
/* Cevaplanmış kelime altında küçük nokta */
.pretest-token.answered::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--success);
}

/* Sayaç */
.pretest-progress {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: .03em;
}

/* Giriş paneli */
.pretest-panel {
  background: var(--walnut);
  color: var(--cream);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.5rem 1rem;
  margin: 1.2rem 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  box-shadow: var(--shadow-md);
  animation: fadeUp .15s ease both;
}

.pretest-panel-word {
  font-family: var(--font-ar);
  font-size: 2.4rem;
  color: var(--gold);
  line-height: 1.3;
  text-align: right;
}

.pretest-panel-context {
  font-family: var(--font-ar);
  font-size: 1.1rem;
  color: rgba(250,247,242,.45);
  line-height: 2;
  text-align: right;
  letter-spacing: .02em;
}
.pretest-ctx-highlight {
  color: var(--gold-light);
  font-weight: 700;
}

.pretest-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.pretest-input-wrapper .transcription-input {
  flex: 1;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.2);
  color: var(--cream);
}
.pretest-input-wrapper .transcription-input::placeholder {
  color: rgba(250,247,242,.35);
}
.pretest-input-wrapper .transcription-input:focus {
  border-color: var(--gold);
  background: rgba(255,255,255,.12);
}

/* ══════════════════════════════════════════════════════════════════════
   ÖN TEST / SON TEST — ASSESSMENT SCREEN (izole kart yedek görünümü)
   ══════════════════════════════════════════════════════════════════════ */
.assessment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.assessment-word {
  position: relative;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem .75rem .8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.assessment-word:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.assessment-word.correct  { border-color: var(--success); background: var(--success-bg); }
.assessment-word.fuzzy    { border-color: var(--warn);    background: var(--warn-bg); }
.assessment-word.wrong    { border-color: var(--error);   background: var(--error-bg); }

/* Osmanlıca gösreum */
.osmanlica-display {
  font-family: var(--font-ar);
  font-size: 2rem;
  color: var(--walnut);
  direction: rtl;
  unicode-bidi: embed;
  line-height: 1.4;
  text-align: center;
  width: 100%;
}

/* Input */
.transcription-input {
  width: 100%;
  padding: .45rem .6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: .88rem;
  text-align: center;
  background: #fff;
  color: var(--text-primary);
  transition: border-color var(--transition);
}
.transcription-input:focus {
  outline: none;
  border-color: var(--gold);
}

/* Score badge */
.score-badge {
  font-size: 1.1rem;
  font-weight: 700;
  min-height: 1.4rem;
}
.score-badge.correct { color: var(--success); }
.score-badge.fuzzy   { color: var(--warn); }
.score-badge.wrong   { color: var(--error); }

/* ══════════════════════════════════════════════════════════════════════
   TRAINING / SCAFFOLDING VIEW
   ══════════════════════════════════════════════════════════════════════ */
.text-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1.5rem;
}
.meta-pill {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .28em .8em;
  border-radius: 99px;
  background: var(--cream-dark);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Osmanlıca metin satırı */
.ottoman-text-line {
  direction: rtl;
  unicode-bidi: embed;
  font-family: var(--font-ar);
  font-size: 2rem;
  line-height: 2.2;
  text-align: right;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  row-gap: .2rem;
  margin-bottom: 2rem;
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

/* Kelime token */
.word-token {
  display: inline-block;
  cursor: pointer;
  padding: .15em .35em;
  border-radius: 5px;
  transition: background var(--transition), color var(--transition);
  position: relative;
  color: var(--walnut);
  border-bottom: 2px solid transparent;
}

/* Renk vurgulama (scaffoldFadeLevel 0 = tam renkli) */
.word-token[data-koken="Arapça"]  { border-bottom-color: #185FA5; }
.word-token[data-koken="Farsça"]  { border-bottom-color: #16A34A; }
.word-token[data-koken="Türkçe"]  { border-bottom-color: #185FA5; }

/* soluk (fade level 1) */
.fade-1 .word-token[data-koken] { border-bottom-color: transparent; }
.fade-1 .word-token { opacity: .7; }

/* gizli (fade level 2) */
.fade-2 .word-token { opacity: 1; border-bottom-color: transparent; }

.word-token:hover,
.word-token.active {
  background: var(--gold-dim);
  border-bottom-color: var(--gold) !important;
}

/* ── Bilgi Paneli (filolojik kart) ───────────────────────────────── */
.info-panel {
  background: var(--walnut);
  color: var(--cream);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  animation: fadeUp .2s ease both;
  box-shadow: var(--shadow-md);
}

.info-panel .ottoman-word {
  font-family: var(--font-ar);
  font-size: 2.2rem;
  direction: rtl;
  color: var(--gold);
  line-height: 1.3;
}

.info-click-level {
  display: flex;
  gap: .5rem;
}
.info-click-level .level-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
}
.info-click-level .level-dot.filled { background: var(--gold); }

.info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.info-tag {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: .2em .6em;
  border-radius: 99px;
  background: rgba(24,95,165,.2);
  color: var(--gold-light);
  text-transform: uppercase;
}

.info-content {
  font-size: .95rem;
  line-height: 1.6;
  color: rgba(250,247,242,.9);
}

.info-hint-label {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(250,247,242,.45);
  margin-bottom: .2rem;
}

.info-click-prompt {
  font-size: .8rem;
  color: rgba(250,247,242,.5);
  font-style: italic;
  margin-top: auto;
  padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ── Scaffold Progress (3 nokta) ─────────────────────────────────── */
.scaffold-dots {
  display: flex;
  gap: .4rem;
  align-items: center;
  margin-top: .3rem;
}
.scaffold-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  transition: background var(--transition);
}
.scaffold-dot.lit { background: var(--gold); }

/* ══════════════════════════════════════════════════════════════════════
   QUIZ / DEĞERLENDİRME PANELİ
   ══════════════════════════════════════════════════════════════════════ */
.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.quiz-question {
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  transition: border-color var(--transition);
}
.quiz-question.correct { border-color: var(--success); background: var(--success-bg); }
.quiz-question.wrong   { border-color: var(--error);   background: var(--error-bg); }

.sentence-quiz-mode {
  padding: 1.5rem;
}
.quiz-q-header {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--walnut);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.quiz-target-word {
  /* Vurgulanan hedef kelime JS içerisinde de renkleniyor, burası opsiyonel fallback stilleri */
  position: relative;
  display: inline-block;
}

.quiz-input-wrapper {
  margin-top: 1rem;
}

/* Eski çoktan seçmeli butonlarını tutuyoruz (sorun olmaz), input'lar transcription-input'u ortak kullanıyor */

/* ── Skor Kartı ──────────────────────────────────────────────────── */
.score-card {
  background: var(--walnut);
  color: var(--cream);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.score-card .big-number {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: .3rem;
}
.score-card .score-label {
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .6;
  margin-bottom: 1rem;
}
.score-card .score-breakdown {
  font-size: .85rem;
  opacity: .75;
  line-height: 1.7;
}

/* Öğrenme Kazanımı (g) göstergesi */
.gain-meter {
  margin: 1.2rem 0;
  background: rgba(255,255,255,.1);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
}
.gain-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 99px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

/* Kategori geri bildirimi */
.feedback-list {
  list-style: none;
  margin-top: 1rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.feedback-list li {
  background: rgba(255,255,255,.07);
  border-radius: var(--radius-sm);
  padding: .6rem .9rem;
  font-size: .85rem;
  line-height: 1.5;
}
.feedback-list li strong { color: var(--gold-light); }

/* ══════════════════════════════════════════════════════════════════════
   KILIT DURUMU
   ══════════════════════════════════════════════════════════════════════ */
.locked-overlay {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.locked-overlay .lock-icon { font-size: 3rem; margin-bottom: 1rem; }
.locked-overlay p { font-size: .9rem; line-height: 1.6; }

/* ══════════════════════════════════════════════════════════════════════
   TOAST BİLDİRİMLERİ
   ══════════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  background: var(--walnut);
  color: var(--cream);
  padding: .7rem 1.4rem;
  border-radius: 99px;
  font-size: .85rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease both;
  pointer-events: auto;
  border-left: 3px solid var(--gold);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--error); }
@keyframes toastIn {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE  —  Tablet (≥768px)
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  main { padding: 2.5rem 2rem 5rem; }
  .screen-card { padding: 3rem 2.8rem; }
  .assessment-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .ottoman-text-line { font-size: 2.4rem; gap: .6rem; padding: 2rem; }
  .osmanlica-display { font-size: 2.4rem; }
  .quiz-options { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE  —  Desktop (≥1100px)
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 1100px) {
  main { padding: 3rem 3rem 6rem; }
  .screen-card { padding: 3.5rem 3.5rem; }
  .ottoman-text-line { font-size: 2.6rem; }
}

/* ══════════════════════════════════════════════════════════════════════
   SENTENCE TEXTAREA BLOCK (pre-test and post-test)
   ══════════════════════════════════════════════════════════════════════ */
.sentence-assessment-block {
  margin-bottom: 1.5rem;
}
.sentence-assessment-ottoman {
  direction: rtl;
  font-family: var(--font-ar);
  font-size: 2rem;
  line-height: 2;
  color: var(--walnut);
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 1.2rem 1.5rem;
  text-align: right;
}
.sentence-assessment-textarea {
  width: 100%;
  padding: .8rem 1rem;
  border: 1.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-family: var(--font-ui);
  font-size: .95rem;
  resize: none;
  min-height: 3rem;
  max-height: 5.5rem;
  overflow-y: auto;
  background: #fff;
  color: var(--text-primary);
  transition: border-color var(--transition);
}
.sentence-assessment-textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.sentence-assessment-textarea.filled {
  border-color: var(--text-muted);
}

/* Training sentence block */
.training-sentence-block {
  display: block;
  width: 100%;
}

/* Inline Info Panel — kelimenin altında anında açılan iskele kartı */
.inline-info-panel {
  background: var(--walnut);
  color: var(--cream);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
  margin: .5rem 0 .8rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  animation: fadeUp .18s ease both;
  box-shadow: var(--shadow-md);
  width: 100%;
  box-sizing: border-box;
}
.inline-info-panel .ottoman-word {
  font-family: var(--font-ar);
  font-size: 2rem;
  direction: rtl;
  color: var(--gold);
  line-height: 1.3;
}

/* ══════════════════════════════════════════════════════════════════════
   POST-TEST TRUE/FALSE
   ══════════════════════════════════════════════════════════════════════ */
.posttest-tf-section {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.posttest-tf-section h3 {
  font-size: 1rem;
  color: var(--walnut);
  margin-bottom: .45rem;
}

.posttest-tf-desc {
  font-size: .86rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: .9rem;
}

.posttest-tf-tools {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  margin-bottom: .9rem;
}

.posttest-tf-status {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.posttest-tf-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .8rem;
  margin-bottom: .7rem;
  background: var(--cream);
}

.posttest-tf-q {
  font-family: var(--font-ar);
  font-size: 1.25rem;
  line-height: 1.8;
  color: var(--walnut);
  direction: rtl;
  text-align: right;
  margin-bottom: .65rem;
}

.posttest-tf-actions {
  display: flex;
  gap: .55rem;
}

.posttest-tf-actions .btn {
  flex: 1;
  min-height: 42px;
}

.posttest-tf-actions .btn.tf-selected {
  outline: 2px solid var(--gold);
  box-shadow: 0 0 0 2px rgba(24,95,165,.2);
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE  —  Mobile (<=640px)
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  main {
    padding: 1rem .75rem 3.2rem;
  }

  .site-header {
    padding: .8rem .9rem;
    gap: .7rem;
    flex-wrap: wrap;
  }

  .site-header .logo {
    font-size: 1.25rem;
    line-height: 1.2;
  }

  .site-header .subtitle {
    font-size: .65rem;
    width: 100%;
  }

  .global-progress {
    width: 100%;
  }

  .screen-card {
    padding: 1.15rem .95rem;
    border-radius: 14px;
  }

  .screen-card h2 {
    font-size: 1.08rem;
    gap: .45rem;
    flex-wrap: wrap;
  }

  .screen-card .desc {
    font-size: .85rem;
    margin-bottom: 1.2rem;
  }

  .phase-bar {
    gap: .35rem;
    margin-bottom: 1.2rem;
  }

  .phase-step {
    font-size: .63rem;
    letter-spacing: .01em;
  }

  .phase-sep {
    min-width: 8px;
  }

  .ottoman-text-line {
    font-size: 1.55rem;
    line-height: 1.9;
    padding: .9rem;
    margin-bottom: 1.1rem;
  }

  .inline-info-panel {
    padding: .85rem .9rem;
  }

  .inline-info-panel .ottoman-word {
    font-size: 1.45rem;
  }

  .sentence-assessment-ottoman {
    font-size: 1.45rem;
    line-height: 1.7;
    padding: .75rem .8rem;
  }

  .transcription-input {
    min-height: 44px;
    font-size: 1rem;
  }

  .btn {
    width: 100%;
    min-height: 44px;
    font-size: .92rem;
  }

  .quiz-q-header {
    font-size: .8rem;
    align-items: flex-start;
    gap: .5rem;
    flex-direction: column;
  }

  .score-card .big-number {
    font-size: 2.5rem;
  }

  .float-feedback {
    bottom: 1rem;
    left: .8rem;
    font-size: .72rem;
    padding: .5rem .9rem .5rem .75rem;
  }
}
.inline-info-panel .info-content {
  font-size: .9rem;
  line-height: 1.6;
  color: rgba(250,247,242,.9);
}
.inline-info-panel .info-hint-label {
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(250,247,242,.45);
  margin-bottom: .15rem;
}
.inline-info-panel .info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.inline-info-panel .info-tag {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: .2em .55em;
  border-radius: 99px;
  background: rgba(24,95,165,.2);
  color: var(--gold-light);
  text-transform: uppercase;
}
.inline-info-panel .scaffold-dots {
  display: flex;
  gap: .4rem;
  align-items: center;
}
.inline-info-panel .info-click-prompt {
  font-size: .78rem;
  color: rgba(250,247,242,.5);
  font-style: italic;
  padding-top: .4rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ══════════════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════════════ */
footer {
  text-align: center;
  padding: 2rem 1rem 1rem;
  font-size: .75rem;
  color: var(--text-light);
  letter-spacing: .04em;
}
/* ══════════════════════════════════════════════════════════════════════
   MODAL / GUIDE OVERLAY
   ══════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4,44,83, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-content {
  background: var(--cream);
  max-width: 500px;
  width: 100%;
  border-radius: var(--radius-lg);
  padding: 2.2rem 2rem;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--gold);
  animation: modalScale .3s cubic-bezier(.175,.885,.32,1.275);
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-content h3 {
  font-size: 1.5rem;
  color: var(--walnut);
  margin-bottom: 0.8rem;
  text-align: center;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.guide-step {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.gs-icon {
  width: 32px; height: 32px;
  background: var(--gold);
  color: var(--walnut);
  border-radius: 50%;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--gold-dim);
}

.gs-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.guide-footer {
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

/* ══════════════════════════════════════════════════════════════════════
   SEVİYE HARİTASI
   ══════════════════════════════════════════════════════════════════════ */
.level-map {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 1.5rem;
}
.level-node {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700;
  cursor: default;
  flex-shrink: 0;
  transition: background .25s, box-shadow .25s;
}
.level-node.done {
  background: var(--success);
  color: #fff;
  box-shadow: 0 2px 8px rgba(121,184,150,.35);
}
.level-node.active {
  background: var(--gold);
  color: var(--walnut);
  box-shadow: 0 0 0 3px rgba(219,182,108,.35);
}
.level-node.locked {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.3);
  border: 1.5px solid rgba(255,255,255,.12);
}
.level-connector {
  width: 22px; height: 2px;
  background: rgba(255,255,255,.15);
  flex-shrink: 0;
}
.level-connector.done { background: var(--success); }

/* ══════════════════════════════════════════════════════════════════════
   ÖZGÜVEN KALİBRASYONU
   ══════════════════════════════════════════════════════════════════════ */
.confidence-block {
  background: rgba(219,182,108,.07);
  border: 1px solid rgba(219,182,108,.22);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
}
.confidence-label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: .65rem;
}
.confidence-slider-row {
  display: flex;
  align-items: center;
  gap: .7rem;
}
.confidence-range {
  flex: 1;
  accent-color: var(--gold);
  cursor: pointer;
}
.confidence-limit {
  font-size: .72rem;
  opacity: .55;
  min-width: 1.5ch;
}
.confidence-display {
  text-align: center;
  margin-top: .5rem;
  font-size: .9rem;
}
.confidence-display strong { color: var(--gold); font-size: 1.1rem; }
.confidence-result {
  background: rgba(219,182,108,.07);
  border: 1px solid rgba(219,182,108,.22);
  border-radius: var(--radius-sm);
  padding: .85rem 1.1rem;
  margin: 1rem 0 1.5rem;
  font-size: .88rem;
  line-height: 1.7;
}

/* ══════════════════════════════════════════════════════════════════════
   STREAK OVERLAY
   ══════════════════════════════════════════════════════════════════════ */
.streak-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  background: rgba(10,5,0,.88);
  color: var(--gold-light);
  font-size: 1.6rem;
  font-weight: 700;
  padding: .75rem 2rem;
  border-radius: 3rem;
  z-index: 9000;
  pointer-events: none;
  border: 1.5px solid rgba(219,182,108,.4);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  opacity: 1;
  transition: opacity .5s ease, transform .5s ease;
  white-space: nowrap;
  display: none;
}
.streak-overlay.visible {
  display: block;
}
.streak-overlay.fade-out {
  opacity: 0;
  transform: translate(-50%, -62%) scale(1.12);
}

/* ══════════════════════════════════════════════════════════════════════
   MİNİ TEKRAR DÖNGÜSÜ
   ══════════════════════════════════════════════════════════════════════ */
.mini-review-progress {
  text-align: center;
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}
.mini-review-progress strong { color: var(--gold); }
.mini-review-grid {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}
.mini-review-item {
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem;
  transition: border-color .2s, background .2s;
}
.mini-review-item.mr-correct {
  border-color: var(--success);
  background: var(--success-bg);
}
.mini-review-item.mr-wrong {
  border-color: var(--error);
  background: var(--error-bg);
}
.mr-ottoman-word {
  font-family: var(--font-ar);
  font-size: 2rem;
  direction: rtl;
  text-align: right;
  color: var(--walnut);
  margin-bottom: .55rem;
  line-height: 1.55;
}
.mr-context {
  font-size: .75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: .4rem;
}
.mr-input { width: 100%; margin: .5rem 0 .3rem; }
.mr-feedback { font-size: .85rem; font-weight: 600; min-height: 1.3rem; }

/* Kategori öğrenme ipucu */
.cat-tip {
  display: block;
  font-size: .77rem;
  color: var(--text-muted);
  font-style: normal;
  margin-top: .25rem;
  line-height: 1.5;
}
