:root {
  --bg: #fff5f8;
  --blush: #ffe4ee;
  --petal: #ffd0e0;
  --rose: #f48fb1;
  --deep: #d9577f;
  --ink: #4b2a37;
  --ink2: #6f4a59;
  --muted: #a98494;
  --card: #ffffff;
  --line: #f6d7e2;
  --ok: #3aa776;
  --ok-soft: #e4f6ec;
  --bad: #e0566a;
  --bad-soft: #fde6ea;
  --g1: #f49ab9;
  --g2: #e0648f;
  --shadow: 0 6px 22px -10px rgba(120, 60, 80, .28);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 600 16px/1.55 var(--sans);
  background: radial-gradient(120% 60% at 50% 0%, var(--blush) 0%, var(--bg) 60%) fixed, var(--bg);
  min-height: 100vh; touch-action: manipulation; -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
}
#app { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 16px) 18px calc(env(safe-area-inset-bottom) + 36px); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; text-align: inherit; }
b { font-weight: 800; }

/* ---------- kalpler ---------- */
#hearts { position: fixed; inset: 0; pointer-events: none; z-index: 99; overflow: hidden; }
.heart {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; color: var(--rose);
  animation: floaty 1.25s cubic-bezier(.2,.7,.3,1) forwards;
}
.heart svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 3px rgba(217,87,127,.25)); }
@keyframes floaty {
  0% { transform: translate(0,0) scale(.3) rotate(0deg); opacity: 0; }
  15% { opacity: 1; transform: translate(calc(var(--dx) * .2), -14px) scale(1) rotate(calc(var(--rot) * .3)); }
  100% { transform: translate(var(--dx), var(--dy)) scale(.8) rotate(var(--rot)); opacity: 0; }
}

/* ---------- üst kısım ---------- */
.hello { text-align: center; padding: 10px 0 6px; }
.hello .eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--deep); font-weight: 800; }
.hello h1 { font: italic 600 44px/1.05 var(--serif); margin: 8px 0 6px; color: var(--ink); }
.hello h1 span { color: var(--deep); }
.hello p { margin: 0 auto; max-width: 320px; color: var(--ink2); font-weight: 600; }

.ring { display: flex; align-items: center; gap: 16px; background: var(--card); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); margin: 18px 0 14px; }
.ring svg { width: 74px; height: 74px; flex: none; }
.ring .t { font-weight: 800; font-size: 17px; }
.ring .d { color: var(--muted); font-size: 14px; }
.stats3 { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; color: var(--ink2); }
.stats3 b { color: var(--deep); }

.big {
  display: flex; align-items: center; gap: 14px; width: 100%; border-radius: 22px; padding: 18px 18px;
  background: linear-gradient(135deg, var(--g1), var(--g2)); color: #fff; box-shadow: 0 12px 26px -14px var(--g2);
  margin-bottom: 12px;
}
.big .ic { font-size: 30px; line-height: 1; }
.big .t { font: italic 600 22px/1.15 var(--serif); }
.big .d { font-size: 13.5px; opacity: .92; font-weight: 600; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  background: var(--card); border-radius: 20px; padding: 15px 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px; min-height: 112px; position: relative;
}
.tile .ic { font-size: 24px; }
.tile .t { font-weight: 800; font-size: 15.5px; }
.tile .d { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.tile .badge { position: absolute; top: 12px; right: 12px; background: var(--bad); color: #fff; border-radius: 99px; font-size: 12px; font-weight: 800; padding: 1px 8px; }
.tile.wide { grid-column: span 2; min-height: 0; flex-direction: row; align-items: center; gap: 12px; }

.sect { font: italic 600 21px/1.2 var(--serif); margin: 26px 4px 10px; display: flex; align-items: center; gap: 8px; }
.sect::after { content: ""; flex: 1; height: 1.5px; background: var(--petal); border-radius: 2px; }

.unit {
  display: flex; align-items: center; gap: 12px; width: 100%; background: var(--card); border-radius: 18px;
  padding: 13px 14px; box-shadow: var(--shadow); margin-bottom: 10px;
}
.unit .no { width: 38px; height: 38px; border-radius: 50%; background: var(--blush); color: var(--deep); display: grid; place-items: center; font: italic 600 18px var(--serif); flex: none; }
.unit .t { font-weight: 800; font-size: 15px; line-height: 1.3; }
.unit .d { font-size: 12.5px; color: var(--muted); }
.bar { height: 6px; border-radius: 9px; background: var(--blush); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--rose), var(--deep)); border-radius: 9px; }
.grow { flex: 1; min-width: 0; }
.chev { color: var(--rose); font-size: 22px; font-weight: 800; }

.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 30px; }
.foot .sig { font: italic 500 18px var(--serif); color: var(--deep); display: block; margin-top: 4px; }

/* ---------- üst bar ---------- */
.top { display: flex; align-items: center; gap: 12px; margin: 2px 0 16px; }
.back { width: 42px; height: 42px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--deep); font-size: 22px; font-weight: 800; flex: none; }
.top h2 { font: italic 600 23px/1.15 var(--serif); margin: 0; }
.top .sub { font-size: 13px; color: var(--muted); }
.prog { height: 7px; background: var(--card); border-radius: 9px; overflow: hidden; margin: -6px 0 16px; box-shadow: inset 0 0 0 1px var(--line); }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--rose), var(--deep)); border-radius: 9px; transition: width .3s; }

/* ---------- soru ---------- */
.qcard { background: var(--card); border-radius: 24px; padding: 18px 16px; box-shadow: var(--shadow); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: var(--blush); color: var(--deep); }
.tag.book { background: var(--ink); color: var(--card); }
.qtext { font-size: 17.5px; line-height: 1.5; font-weight: 700; color: var(--ink); }
.opts { display: grid; gap: 9px; margin-top: 16px; }
.opt {
  display: flex; gap: 11px; align-items: flex-start; width: 100%; padding: 12px 12px; border-radius: 16px;
  background: var(--bg); border: 2px solid var(--line); font-size: 15.5px; line-height: 1.42; font-weight: 600; transition: transform .12s;
}
.opt:active { transform: scale(.985); }
.opt .k { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--card); border: 2px solid var(--petal); display: grid; place-items: center; font-weight: 800; font-size: 13.5px; color: var(--deep); }
.opt.sel { border-color: var(--rose); background: var(--blush); }
.opt.sel .k { background: var(--rose); border-color: var(--rose); color: #fff; }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .k { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .k { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt.dim { opacity: .5; }

.fb { margin-top: 14px; border-radius: 18px; padding: 14px; font-size: 15px; line-height: 1.5; }
.fb.ok { background: var(--ok-soft); }
.fb.bad { background: var(--bad-soft); }
.fb .h { font: italic 600 20px var(--serif); margin-bottom: 4px; }
.fb.ok .h { color: var(--ok); }
.fb.bad .h { color: var(--bad); }
.fb .link { display: inline-block; margin-top: 8px; color: var(--deep); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; border-radius: 18px;
  background: linear-gradient(135deg, var(--g1), var(--g2)); color: #fff; font-weight: 800; font-size: 16px; text-align: center;
  box-shadow: 0 10px 22px -14px var(--g2);
}
.btn.ghost { background: var(--card); color: var(--deep); box-shadow: var(--shadow); }
.btn[disabled] { opacity: .4; }
.btns { display: grid; gap: 10px; margin-top: 14px; }
.btns.two { grid-template-columns: 1fr 1fr; }
.timer { font-weight: 800; color: var(--deep); font-variant-numeric: tabular-nums; }
.timer.low { color: var(--bad); }

/* ---------- sonuç ---------- */
.score { text-align: center; background: var(--card); border-radius: 26px; padding: 26px 16px; box-shadow: var(--shadow); }
.score .n { font: italic 600 64px/1 var(--serif); color: var(--deep); }
.score .n small { font-size: 28px; color: var(--muted); }
.score .msg { font-size: 16px; margin-top: 10px; color: var(--ink2); }

.item { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden; }
.item > summary { list-style: none; padding: 13px 14px; cursor: pointer; font-size: 15px; font-weight: 700; display: flex; gap: 10px; }
.item > summary::-webkit-details-marker { display: none; }
.item > summary::after { content: "›"; margin-left: auto; color: var(--rose); font-size: 22px; line-height: 1; transition: transform .2s; }
.item[open] > summary::after { transform: rotate(90deg); }
.item .body { padding: 0 14px 14px; font-size: 15px; }
.ans { border-left: 4px solid; border-radius: 4px 12px 12px 4px; padding: 8px 10px; margin-top: 8px; }
.ans.y { border-color: var(--bad); background: var(--bad-soft); }
.ans.c { border-color: var(--ok); background: var(--ok-soft); }
.ans .l { display: block; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; }
.ans.y .l { color: var(--bad); }
.ans.c .l { color: var(--ok); }
.why { margin-top: 8px; color: var(--ink2); }

.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty .e { font-size: 46px; }

/* ---------- konu anlatımı ---------- */
.notes { background: var(--card); border-radius: 24px; padding: 18px 16px; box-shadow: var(--shadow); font-size: 16px; line-height: 1.65; color: var(--ink2); font-weight: 600; }
.notes h3 { font: italic 600 21px/1.25 var(--serif); color: var(--deep); margin: 22px 0 8px; }
.notes h3:first-child { margin-top: 0; }
.notes p { margin: 0 0 10px; }
.notes ul { margin: 0 0 12px; padding-left: 20px; }
.notes li { margin-bottom: 6px; }
.notes li::marker { color: var(--rose); }
.notes b { color: var(--ink); }
.notes .box { background: var(--blush); border-radius: 14px; padding: 11px 13px; margin: 8px 0 12px; color: var(--ink); }
mark { background: linear-gradient(transparent 52%, var(--petal) 52%); color: inherit; padding: 0 1px; }

.seg { display: flex; gap: 6px; background: var(--card); padding: 4px; border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 14px; }
.seg button { flex: 1; padding: 8px 4px; border-radius: 11px; font-size: 14px; font-weight: 800; color: var(--muted); text-align: center; }
.seg button.on { background: var(--blush); color: var(--deep); }

/* ---------- ayarlar ---------- */
.panel { background: var(--card); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); }
.panel .lab { font-size: 13px; color: var(--muted); font-weight: 800; letter-spacing: .04em; margin-bottom: 10px; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; border: 2px solid var(--line); font-size: 13px; font-weight: 800; color: var(--ink2); }
.theme i { width: 34px; height: 34px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 3px rgba(255,255,255,.7); }
.theme.on { border-color: var(--deep); color: var(--deep); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-top: 16px; padding-top: 14px; border-top: 1.5px solid var(--line); }
.sw { width: 50px; height: 30px; border-radius: 99px; background: var(--petal); position: relative; flex: none; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.sw.on { background: var(--deep); }
.sw.on::after { transform: translateX(20px); }
.tile .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--blush); color: var(--deep); display: grid; place-items: center; font: italic 600 17px var(--serif); margin-bottom: 4px; }
