:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg2: #eef2fb;
  --card: #ffffff;
  --ink: #1f2937;
  --ink-soft: #64748b;
  --primary: #4f46e5;
  --primary-soft: #eef2ff;
  --accent: #0ea5e9;
  --accent-soft: #e0f2fe;
  --success: #059669;
  --success-soft: #d1fae5;
  --warm: #d97706;
  --warm-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --yellow: #f59e0b;
  --line: #e5e9f2;
  --shadow: 0 4px 16px rgba(30, 41, 59, .08);
  --shadow-lg: 0 14px 40px rgba(30, 41, 59, .16);
  --radius: 18px;
  --font-head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --nav-h: 66px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }

/* ---------- üst bar & navigasyon ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 24px;
  background: rgba(245, 247, 251, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; white-space: nowrap; }
.brand-mark { color: var(--primary); letter-spacing: -.5px; }
.brand-text { color: var(--ink); }
.nav { display: flex; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  font-weight: 600; color: var(--ink-soft); transition: .2s;
}
.nav a b { font-weight: 600; }
.nav a:hover { background: var(--primary-soft); color: var(--primary); }
.nav a.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, .35); }

.container { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 24px 20px 60px; }

@media (max-width: 760px) {
  .topbar { padding: 10px 16px; justify-content: space-between; backdrop-filter: none; background: rgba(245, 247, 251, .97); }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    justify-content: space-around; gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 20px rgba(30, 41, 59, .08);
  }
  .nav a { flex-direction: column; gap: 0; padding: 4px 2px; border-radius: 14px; font-size: .66rem; min-width: 0; flex: 1; white-space: nowrap; }
  .nav a span { font-size: 1.25rem; }
  .nav a.active { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
  .container { padding: 16px 16px calc(var(--nav-h) + 40px); }
  h1 { font-size: 1.45rem; }
}

/* ---------- genel bileşenler ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.card.soft-primary { background: linear-gradient(135deg, #fff 0%, var(--primary-soft) 100%); }
.card.soft-accent { background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 100%); }
.card.soft-warm { background: linear-gradient(135deg, #fff 0%, var(--warm-soft) 100%); }
.card.soft-success { background: linear-gradient(135deg, #fff 0%, var(--success-soft) 100%); }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .grid-2.stack-sm { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer;
  padding: 12px 20px; border-radius: 999px;
  font-weight: 700; font-size: 1rem;
  background: var(--primary); color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .3);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(79, 70, 229, .36); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.accent { background: var(--accent); box-shadow: 0 6px 16px rgba(14, 165, 233, .3); }
.btn.success { background: var(--success); box-shadow: 0 6px 16px rgba(5, 150, 105, .3); }
.btn.warm { background: var(--warm); box-shadow: 0 6px 16px rgba(217, 119, 6, .3); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: none; border: 2px solid var(--line); }
.btn.ghost:hover { border-color: var(--primary); }
.btn.sm { padding: 8px 14px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.icon-btn {
  border: 0; background: var(--primary-soft); color: var(--primary);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.1rem;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.icon-btn:hover { background: var(--primary); color: #fff; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px;
  background: #fff; border: 2px solid var(--line);
  font-weight: 600; font-size: .85rem; cursor: pointer;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--primary-soft); color: var(--primary); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge.success { background: var(--success-soft); color: #047857; }
.badge.warm { background: var(--warm-soft); color: #b45309; }
.badge.hard { background: #ffe4e6; color: #be123c; margin-right: 6px; }

.progress { height: 12px; background: #edf0f7; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; transition: width .4s; }

/* ---------- ana sayfa ---------- */
.hero { display: flex; flex-direction: column; gap: 6px; }
.hero h1 { color: var(--ink); margin-bottom: 0; }

.stat-big { font-family: var(--font-head); font-size: 2.4rem; font-weight: 800; line-height: 1; }
.stat-label { font-weight: 700; color: var(--ink-soft); font-size: .85rem; }
.countdown .stat-big { color: var(--primary); }

.ring { --p: 0; width: 86px; height: 86px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--success) calc(var(--p) * 1%), var(--success-soft) 0);
  display: grid; place-items: center; }
.ring > div { width: 66px; height: 66px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; }

.tile {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px; border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow); border: 2px solid transparent;
  transition: transform .15s, border-color .15s; cursor: pointer; text-align: left;
}
.tile:hover { transform: translateY(-3px); border-color: var(--primary-soft); }
.tile .tile-emoji { font-size: 1.8rem; }
.tile b { font-family: var(--font-head); font-size: 1.08rem; }
.tile span.muted { font-size: .85rem; }

.wod-word { font-family: var(--font-head); font-size: 1.9rem; color: var(--primary); }

/* ---------- soru ekranı ---------- */
.quiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.quiz-head .progress { flex: 1; }
.quiz-count { font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.qdots { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.qdot { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); color: var(--ink-soft); font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; padding: 0; }
.qdot:hover { border-color: var(--primary); }
.qdot.ok { background: var(--success-soft); border-color: var(--success); color: var(--ink); }
.qdot.no { background: var(--red-soft); border-color: var(--red); color: var(--ink); }
.qdot.seen { background: var(--primary-soft); border-color: var(--primary-soft); }
.qdot.cur { outline: 2.5px solid var(--primary); outline-offset: 1.5px; color: var(--ink); }
.quiz-nav { margin-top: 16px; align-items: center; }
.quiz-nav .btn[disabled] { opacity: .4; pointer-events: none; }
.revisit .option.wrong { animation: none; }
.passage {
  background: #fbfcff; border: 2px dashed #dbe3f5; border-radius: 14px;
  padding: 16px 18px; margin-bottom: 14px; font-size: 1rem; line-height: 1.7;
  max-height: 46vh; overflow-y: auto;
}
.passage h4 { color: var(--primary); margin-bottom: 6px; }
.blank { display: inline-block; min-width: 44px; padding: 0 6px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.blank.current { background: var(--primary); color: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, .45); } 50% { box-shadow: 0 0 0 6px rgba(79, 70, 229, 0); } }
.question-text { font-size: 1.12rem; font-weight: 600; margin-bottom: 16px; line-height: 1.6; }
.question-text .gap { color: var(--primary); font-weight: 800; letter-spacing: 1px; }
.dialog-line { display: block; padding: 6px 0; }
.dialog-line b { color: var(--primary); }

.options { display: grid; gap: 10px; }
.option {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  width: 100%; padding: 13px 15px; border-radius: 14px; cursor: pointer;
  background: #fff; border: 2px solid var(--line); font-size: 1rem; font-weight: 500;
  transition: border-color .15s, background .15s, transform .1s;
}
.option:hover:not(:disabled) { border-color: var(--primary); background: #f8faff; }
.option:active:not(:disabled) { transform: scale(.99); }
.option .letter {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .85rem;
  background: var(--primary-soft); color: var(--primary);
}
.option.correct { border-color: var(--success); background: var(--success-soft); }
.option.correct .letter { background: var(--success); color: #fff; }
.option.wrong { border-color: var(--red); background: var(--red-soft); animation: shake .4s; }
.option.wrong .letter { background: var(--red); color: #fff; }
.option.picked { border-color: var(--primary); background: var(--primary-soft); }
.option.picked .letter { background: var(--primary); color: #fff; }
.option:disabled { cursor: default; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.explain {
  display: flex; gap: 14px; align-items: flex-start;
  margin-top: 16px; padding: 14px; border-radius: 14px;
  background: var(--primary-soft); animation: fadeIn .35s ease-out;
}
.explain .who { font-weight: 800; color: var(--primary); font-size: .85rem; margin-bottom: 2px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(30, 41, 59, .4); backdrop-filter: blur(4px); }
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 20px; padding: 24px; max-width: 380px; width: 100%; text-align: center; box-shadow: var(--shadow-lg); animation: fadeIn .25s ease-out; }
.modal-box .row { justify-content: center; margin-top: 14px; }

/* ---------- kelime kartları ---------- */
.flash-wrap { perspective: 1200px; max-width: 520px; margin: 0 auto; }
.flash {
  position: relative; height: 320px; cursor: pointer;
  transform-style: preserve-3d; transition: transform .55s cubic-bezier(.4, 1.4, .5, 1);
}
.flash.flipped { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 20px; padding: 24px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.flash-front { background: linear-gradient(135deg, #fff 0%, var(--primary-soft) 100%); }
.flash-back { background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 100%); transform: rotateY(180deg); }
.flash-word { font-family: var(--font-head); font-size: 2.3rem; color: var(--ink); }
.flash-tr { font-family: var(--font-head); font-size: 1.45rem; color: var(--primary); margin-bottom: 10px; }
.flash-ex { font-style: italic; }
.flash-ex mark, .word-ex mark { background: var(--yellow); border-radius: 4px; padding: 0 3px; font-style: normal; font-weight: 700; color: var(--ink); }
.flash-hint { position: absolute; bottom: 14px; font-size: .8rem; color: var(--ink-soft); }
.flash-speak { position: absolute; top: 14px; right: 14px; }

.word-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.word-row:last-child { border-bottom: 0; }
.word-row .w { font-weight: 700; font-size: 1.05rem; }
.word-row .tr { color: var(--ink-soft); font-size: .92rem; }
.word-ex { padding: 0 4px 12px; font-size: .92rem; border-bottom: 1px solid var(--line); }
.letters { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.letter { min-width: 32px; height: 32px; padding: 0 6px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; }
.letter.wide { padding: 0 10px; }
.letter:hover { border-color: var(--primary); }
.letter.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pager-nums { display: flex; align-items: center; gap: 5px; }
.pager .btn[disabled] { opacity: .4; pointer-events: none; }
.stars { color: var(--yellow); letter-spacing: 1px; white-space: nowrap; font-size: .85rem; }
.input {
  width: 100%; padding: 12px 16px; border-radius: 999px; border: 2px solid var(--line);
  font: inherit; font-weight: 500; background: #fff; color: var(--ink); outline: none;
}
.input:focus { border-color: var(--primary); }
select.input { appearance: auto; }

/* ---------- gramer ---------- */
.gram-body table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: .92rem; display: block; overflow-x: auto; }
.gram-body th, .gram-body td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.gram-body th { background: var(--primary-soft); }
.gram-body h4 { color: var(--primary); margin-top: 18px; }
.gram-body ul { padding-left: 20px; }
.gram-body li { margin-bottom: 6px; }
.tip { background: var(--warm-soft); border-radius: 14px; padding: 12px 14px; margin-top: 14px; }

/* ---------- istatistik ---------- */
.bar-row { display: grid; grid-template-columns: 150px 1fr 60px; gap: 10px; align-items: center; margin-bottom: 10px; font-size: .9rem; font-weight: 700; }
@media (max-width: 480px) { .bar-row { grid-template-columns: 110px 1fr 48px; font-size: .8rem; } }
.days { display: flex; gap: 6px; align-items: flex-end; height: 120px; }
.days .d { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; font-size: .68rem; color: var(--ink-soft); }
.days .d i { width: 100%; max-width: 26px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--primary), var(--accent)); min-height: 4px; }
.days .d.zero i { background: var(--line); }

/* ---------- deneme ---------- */
.timer { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; padding: 6px 14px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.timer.low { background: var(--red-soft); color: var(--red); }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; }
.qnav button { width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--line); background: #fff; font-weight: 800; cursor: pointer; font-size: .8rem; }
.qnav button.done { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.qnav button.cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.qnav button.ok { background: var(--success-soft); border-color: var(--success); color: #047857; }
.qnav button.no { background: var(--red-soft); border-color: var(--red); color: var(--red); }

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { color: var(--ink-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }
.table-wrap { overflow-x: auto; }

details.review { border-bottom: 1px solid var(--line); padding: 10px 0; }
details.review summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; gap: 8px; align-items: flex-start; }
details.review summary::-webkit-details-marker { display: none; }

.empty { text-align: center; padding: 26px 10px; }
.fade-in { animation: fadeIn .35s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- çalışma sayacı ---------- */
.sw {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: #fff; border: 2px solid var(--line); color: var(--ink);
  font: inherit; font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums;
}
.sw:hover { border-color: var(--primary); }
.sw.on { background: var(--success-soft); border-color: #6ee7b7; }
.sw-dot { width: 8px; height: 8px; border-radius: 50%; background: #059669; animation: swPulse 1.2s ease-in-out infinite; }
@keyframes swPulse { 50% { opacity: .25; } }
@media (max-width: 760px) { .sw { padding: 5px 9px; font-size: .78rem; } .sw .sw-ico { display: none; } .sw:not(.on) .sw-ico { display: inline; } }
@media (max-width: 480px) { .brand-text { display: none; } }

.sw-today { font-size: .72rem; font-weight: 700; color: var(--ink-soft); padding-left: 6px; border-left: 1.5px solid #a7e8ca; }
.sw-today i { font-style: normal; }
@media (max-width: 760px) { .sw-today i { display: none; } .sw-today { padding-left: 5px; } }
