/* ===== Agora tema ===== */
:root {
  --bg: #12101c;
  --surface: #211d3a;
  --surface2: #2e2852;
  --text: #f7f5fd;
  --text-dim: #b7b1d1;
  --accent: #9d82ff;
  --accent2: #5ce6eb;
  --accent-soft: #322a58;
  --ok: #4adb87;
  --bad: #ff7a70;
  --gold: #f5c95c;
  --border: #4a4380;
  --shadow: 0 3px 14px rgba(0,0,0,.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  background-image: radial-gradient(700px 400px at 85% -5%, rgba(139,108,255,.12), transparent 60%);
}

/* ===== Üst bar ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1rem;
  padding-top: calc(.7rem + env(safe-area-inset-top));
  background: rgba(28,25,48,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 1.05rem; flex: 1; font-weight: 700; letter-spacing: .02em; }
.icon-btn {
  background: none; border: none; font-size: 1.3rem; cursor: pointer;
  color: var(--text); padding: .25rem .4rem; border-radius: 8px;
}
.icon-btn:active { background: var(--surface2); }
.stats { display: flex; gap: .7rem; font-size: .85rem; font-weight: 700; }
#stat-streak { color: var(--gold); }
#stat-xp { color: var(--accent2); }

main {
  flex: 1; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 1rem; padding-bottom: 3rem;
}
.loading { text-align: center; color: var(--text-dim); padding: 3rem 0; }

/* ===== Yol (path) ===== */
.unit {
  border-radius: 16px;
  padding: .8rem 1rem;
  margin: 1.2rem 0 1rem;
  text-align: center;
  font-weight: 800;
  color: #12101c;
  background: linear-gradient(90deg, var(--accent), #6b4fd8);
  box-shadow: var(--shadow);
}
.unit .u-sub { display: block; font-size: .72rem; font-weight: 600; opacity: .75; }
.unit.locked { background: var(--surface2); color: var(--text-dim); box-shadow: none; }

.path { display: flex; flex-direction: column; align-items: center; padding: .4rem 0; }
.node-wrap { display: flex; flex-direction: column; align-items: center; width: 100%; margin-bottom: 1rem; }
.node-wrap.pos-l { align-items: flex-start; padding-left: 18%; }
.node-wrap.pos-r { align-items: flex-end; padding-right: 18%; }
.node {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; cursor: pointer; position: relative;
  background: var(--surface2); border: 4px solid var(--border);
  box-shadow: 0 5px 0 rgba(0,0,0,.4);
  transition: transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.node:active { transform: translateY(2px); box-shadow: 0 3px 0 rgba(0,0,0,.4); }
.node.done { background: var(--gold); border-color: #d9a93a; box-shadow: 0 5px 0 #a87e26; }
.node.cur { background: var(--accent); border-color: #a68ffb; box-shadow: 0 5px 0 #5b3fb0; animation: pulse 1.8s infinite; }
.node.locked { opacity: .4; filter: grayscale(.7); cursor: default; }
.node.review { background: var(--accent2); border-color: #7eeaf0; box-shadow: 0 5px 0 #2b9ba0; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.node .crowns {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  font-size: .62rem; padding: .05rem .45rem; color: var(--gold); white-space: nowrap;
}
.node .n-badge {
  position: absolute; top: -6px; right: -6px; background: var(--bad); color: #fff;
  border-radius: 999px; min-width: 22px; height: 22px; font-size: .72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.node-lbl { margin-top: .55rem; font-size: .8rem; font-weight: 600; color: var(--text-dim); text-align: center; max-width: 150px; }

/* ===== Ders oturumu ===== */
.lesson-bar { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.1rem; }
.lesson-bar .x { background: none; border: none; color: var(--text-dim); font-size: 1.3rem; cursor: pointer; }
.lesson-bar .pb { flex: 1; height: 14px; background: var(--surface2); border-radius: 8px; overflow: hidden; }
.lesson-bar .pf { height: 100%; background: linear-gradient(90deg, var(--ok), #7fe0a5); border-radius: 8px; transition: width .35s; }

.ex-type {
  font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent2); margin-bottom: .5rem;
}
.ex-type.review { color: var(--gold); }
.ex-q { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; line-height: 1.45; white-space: pre-wrap; }

/* egzersiz bileşenleri */
.opt-list { display: flex; flex-direction: column; gap: .55rem; }
.opt {
  background: var(--surface); border: 2px solid var(--border); border-radius: 14px;
  padding: .85rem 1rem; font-size: .95rem; color: var(--text); text-align: left;
  cursor: pointer; line-height: 1.45; box-shadow: 0 3px 0 rgba(0,0,0,.3);
  -webkit-tap-highlight-color: transparent;
}
.opt:active { transform: translateY(1px); box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.opt:disabled { cursor: default; }
.opt.correct { background: rgba(63,207,122,.18); border-color: var(--ok); color: #8ee7ae; animation: pop .35s; }
.opt.wrong { background: rgba(255,107,96,.15); border-color: var(--bad); color: #ffa39c; animation: shake .4s; }
@keyframes pop { 50% { transform: scale(1.02); } }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.tile {
  background: var(--surface); border: 2px solid var(--border); border-radius: 12px;
  padding: .8rem .5rem; font-size: .9rem; color: var(--text); text-align: center;
  cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.3); line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}
.tile.sel { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.tile.matched { border-color: var(--ok); color: var(--ok); opacity: .5; cursor: default; box-shadow: none; }
.tile.flash-bad { animation: shake .4s; border-color: var(--bad); }

.cloze-text {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 1rem; font-size: 1rem; line-height: 2; margin-bottom: .9rem;
}
.blank {
  display: inline-block; min-width: 76px; border-bottom: 2.5px solid var(--accent);
  text-align: center; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0 .3rem;
}
.blank.empty::after { content: " "; }
.bank { display: flex; flex-wrap: wrap; gap: .5rem; }
.word {
  background: var(--surface2); border: 2px solid var(--border); border-radius: 10px;
  padding: .45rem .85rem; font-size: .92rem; color: var(--text); cursor: pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.3);
  -webkit-tap-highlight-color: transparent;
}
.word.used { opacity: .25; pointer-events: none; }

.order-pool, .order-answer { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .9rem; }
.order-answer { min-height: 48px; border: 2px dashed var(--border); border-radius: 12px; padding: .5rem; }
.o-item {
  display: flex; align-items: center; gap: .6rem;
  background: var(--surface); border: 2px solid var(--border); border-radius: 12px;
  padding: .65rem .8rem; font-size: .9rem; cursor: pointer; line-height: 1.35;
  color: var(--text); /* button varsayılanı koyu gri — koyu zeminde kayboluyordu */
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.o-item .no {
  background: var(--accent); color: #12101c; font-weight: 800; border-radius: 999px;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  font-size: .75rem; flex-shrink: 0;
}

.check-row { margin-top: 1rem; }
.big-btn {
  width: 100%; border: none; border-radius: 14px; padding: .95rem;
  font-size: 1rem; font-weight: 800; cursor: pointer; color: #12101c;
  background: var(--accent); box-shadow: 0 4px 0 #5b3fb0;
  -webkit-tap-highlight-color: transparent;
}
.big-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #5b3fb0; }
.big-btn:disabled {
  background: var(--surface2);
  color: var(--text-dim);
  box-shadow: none;
  cursor: default;
}
.big-btn.ok-btn { background: var(--ok); box-shadow: 0 4px 0 #2a9457; }
.big-btn.ghost { background: var(--surface2); color: var(--text); box-shadow: 0 4px 0 rgba(0,0,0,.35); }

.feedback {
  margin-top: 1rem; border-radius: 14px; padding: .85rem 1rem; font-size: .92rem; line-height: 1.5;
}
.feedback.good { background: rgba(63,207,122,.13); border: 1.5px solid var(--ok); color: #9debb7; }
.feedback.bad { background: rgba(255,107,96,.12); border: 1.5px solid var(--bad); color: #ffb3ac; }
.feedback b { display: block; margin-bottom: .15rem; }

/* ===== Ders sonu ===== */
.finish { text-align: center; padding: 2rem 0 1rem; }
.finish .fx { font-size: 3rem; }
.finish .xp-big { font-size: 2.4rem; font-weight: 900; color: var(--gold); margin: .3rem 0; }
.finish .sub { color: var(--text-dim); font-size: .92rem; margin-bottom: 1.4rem; }
.finish-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .6rem; margin-bottom: 1.6rem; }
.f-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: .8rem .3rem; font-size: .72rem; color: var(--text-dim);
}
.f-box b { display: block; font-size: 1.25rem; color: var(--text); }

.empty-msg { text-align: center; color: var(--text-dim); padding: 2.5rem 1rem; }
.hint { font-size: .8rem; color: var(--text-dim); text-align: center; margin: .6rem 0 1rem; }

/* ===== Canlılık turu: hedef halkası, zengin bantlar, okuma/sandık düğümleri ===== */
.goal-ring {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: conic-gradient(var(--accent2) 0%, var(--surface2) 0% 100%);
}
.goal-ring i {
  width: 18px; height: 18px; border-radius: 50%; background: var(--surface);
  font-style: normal; font-size: .6rem; display: flex; align-items: center; justify-content: center;
}
.goal-ring.done { animation: pop .5s; }

.unit { position: relative; }
.unit .u-sub { display: block; font-size: .72rem; font-weight: 700; opacity: .8; }
.unit.unit-done { background: linear-gradient(90deg, var(--gold), #d9a93a); color: #12101c; }

.node.book {
  border-radius: 22px;
  background: var(--accent2); border-color: #7eeaf0; box-shadow: 0 5px 0 #2b9ba0;
  font-size: 26px;
}
.node.book.done { background: var(--gold); border-color: #d9a93a; box-shadow: 0 5px 0 #a87e26; }
.node.chest {
  border-radius: 16px;
  background: #8a5a2b; border-color: #b5813f; box-shadow: 0 5px 0 #5e3d1c;
}
.node.chest:disabled { opacity: .4; cursor: default; }
.node.chest .n-badge { background: var(--gold); color: #12101c; }

.finish.celebrate .fx { animation: celebrate 1s ease; font-size: 4rem; }
@keyframes celebrate {
  0% { transform: scale(.4) rotate(-12deg); }
  55% { transform: scale(1.25) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}

.theme-card.rich { padding: .8rem 1rem; }
.tc-ring {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.tc-ring i { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); font-style: normal; font-size: 1.35rem; display: flex; align-items: center; justify-content: center; }
.tc-pct { margin-left: auto; flex-shrink: 0; font-size: .8rem; font-weight: 800; color: var(--tc, var(--accent)); }

/* ===== Keşif katmanı (şema v2): hub, tema, koleksiyon, okuyucu ===== */
.hidden { display: none; }
.hub-course {
  display: flex; align-items: center; gap: .9rem; width: 100%;
  background: linear-gradient(120deg, var(--accent-soft), var(--surface));
  border: 1.5px solid var(--accent); border-radius: 16px;
  padding: 1rem 1.1rem; margin-bottom: .6rem; cursor: pointer;
  color: var(--text); text-align: left; box-shadow: var(--shadow); font-size: .95rem;
}
.hub-course small { color: var(--text-dim); }
.hc-icon { font-size: 1.8rem; }
.hc-go { margin-left: auto; color: var(--text-dim); font-size: 1.4rem; }

.theme-grid { display: grid; gap: .6rem; }
.theme-card {
  display: flex; align-items: center; gap: .9rem; width: 100%;
  background: var(--surface); border: 1.5px solid var(--border);
  border-left: 5px solid var(--tc, var(--accent));
  border-radius: 14px; padding: .9rem 1rem; cursor: pointer;
  color: var(--text); text-align: left; box-shadow: var(--shadow);
}
.theme-card:active { transform: scale(.99); }
.tc-icon { font-size: 1.7rem; }
.tc-body b { font-size: 1rem; }
.tc-body small { display: block; color: var(--text-dim); font-size: .8rem; margin-top: .1rem; }

.mode-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.mode-chip {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: .5rem 1rem; font-size: .88rem; font-weight: 600; cursor: pointer;
}

.theme-head {
  display: flex; align-items: flex-start; gap: .8rem;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 5px solid var(--tc, var(--accent));
  border-radius: 14px; padding: .9rem 1rem; margin-bottom: .9rem;
}
.theme-head small { color: var(--text-dim); font-size: .82rem; }

.coll-row, .unit-row {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px;
  padding: .8rem 1rem; margin-bottom: .5rem; cursor: pointer;
  color: var(--text); text-align: left;
}
.coll-row.soon { opacity: .45; cursor: default; }
.cr-body b, .ur-body b { font-size: .95rem; }
.cr-body small, .ur-body small { display: block; color: var(--text-dim); font-size: .78rem; margin-top: .15rem; }
.cr-n { margin-left: auto; flex-shrink: 0; font-size: .75rem; color: var(--accent2); font-weight: 700; }
.coll-row.soon .cr-n { color: var(--text-dim); }
.unit-row .vbadge { margin-left: auto; }
.coll-ozet { color: var(--text-dim); font-size: .88rem; margin-bottom: .9rem; }

.vbadge {
  flex-shrink: 0; border-radius: 999px; padding: .15rem .6rem; font-size: .7rem; font-weight: 700;
}
.vbadge.yorum { background: rgba(242,193,92,.15); color: var(--gold); border: 1px solid var(--gold); }
.vbadge.disputed { background: rgba(255,122,112,.12); color: var(--bad); border: 1px solid var(--bad); }

/* Okuyucu */
.reader {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 1.2rem; box-shadow: var(--shadow);
}
.reader-title { font-size: 1.25rem; line-height: 1.35; margin-bottom: .8rem; }
.unit-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .8rem; }
.chip2 {
  background: var(--surface2); color: var(--text-dim); border-radius: 999px;
  padding: .15rem .6rem; font-size: .72rem; font-weight: 600;
}
.takeaway {
  background: var(--accent-soft); border-left: 4px solid var(--accent2);
  border-radius: 0 10px 10px 0; padding: .7rem .9rem; font-size: .9rem; margin-bottom: 1rem;
}
.takeaway p { margin-bottom: .5rem; }
.reader-body { font-size: .95rem; line-height: 1.65; }
.reader-body p { margin-bottom: .8rem; }
.md-h { font-size: 1.02rem; color: var(--accent2); margin: 1.1rem 0 .5rem; }
.md-ul { margin: 0 0 .8rem 1.2rem; }
.md-ul li { margin-bottom: .35rem; }
.idea {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: .7rem .9rem; margin-bottom: .5rem; font-size: .9rem;
}
.idea b { color: var(--accent); }
.idea p { margin-top: .25rem; color: var(--text-dim); }
.objection {
  background: rgba(255,122,112,.08); border-left: 4px solid var(--bad);
  border-radius: 0 10px 10px 0; padding: .7rem .9rem; font-size: .9rem;
}

/* ===== Laptop/masaüstü okunurluğu: geniş ekranda her şey rem üzerinden büyür ===== */
@media (min-width: 720px) {
  html { font-size: 18px; }
  main { max-width: 700px; }
  .ex-q { font-size: 1.15rem; }
  .opt, .tile, .o-item, .word { font-size: 1rem; }
  .cloze-text { font-size: 1.08rem; }
  .node { width: 84px; height: 84px; font-size: 36px; }
  .node-lbl { font-size: .88rem; max-width: 190px; }
}
@media (min-width: 1200px) {
  html { font-size: 19px; }
}

/* ===== Profil ===== */
.stats { cursor: pointer; border-radius: 10px; padding: .2rem .4rem; }
.stats:active { background: var(--surface2); }
.sec-title {
  font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim); margin: 1.4rem 0 .7rem;
}
.days-chart {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: .4rem; height: 130px; padding: .8rem .6rem .5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  margin-bottom: 1rem;
}
.day-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.day-xp { font-size: .62rem; color: var(--accent2); font-weight: 700; margin-bottom: .15rem; }
.day-bar {
  width: 70%; min-height: 3px; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
}
.day-lbl { font-size: .66rem; color: var(--text-dim); margin-top: .3rem; }
