/* ============================================================
   KitKat components.css — komponent reçeteleri (v1.4)
   tokens.css'e bağımlıdır; birlikte kopyala:
     tokens.css → components.css (→ fonts.css + fonts/)
   Vitrindeki her örnek bu sınıflarla çalışır.
   ============================================================ */

/* ---------- butonlar ---------- */
.btn {
  font: 600 var(--fs-body) var(--font-ui);
  padding: 14px var(--sp-6);
  border-radius: var(--r-md);
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: var(--sp-2);
  transition: transform .08s, opacity .15s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad-accent); color: #fff; box-shadow: var(--shadow-2); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-tonal { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.btn-outline { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-destructive { background: var(--err); color: #fff; }
.btn-glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  color: var(--text); border: 1px solid var(--stroke);
  box-shadow: var(--glass-edge), var(--glass-shadow);
  border-radius: var(--r-pill); /* iOS 26: glass butonda kapsül varsayılan */
}
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-sm { font-size: var(--fs-footnote); padding: 8px var(--sp-4); }
.btn-lg { font-size: var(--fs-title3); padding: 18px var(--sp-8); border-radius: var(--r-lg); }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-pill { border-radius: var(--r-pill); }
.btn-icon { padding: 12px; border-radius: var(--r-pill); font-size: var(--fs-title3); line-height: 1; }
.btn-fab {
  padding: 18px; border-radius: var(--r-pill); font-size: 24px; line-height: 1;
  background: var(--grad-accent); color: #fff; box-shadow: var(--shadow-3);
}

/* ---------- segmented control ---------- */
.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border-radius: var(--r-md);
}
.seg button {
  font: 600 var(--fs-subhead) var(--font-ui);
  padding: 8px var(--sp-4); border: none; cursor: pointer;
  border-radius: calc(var(--r-md) - 3px);
  background: transparent; color: var(--text-dim);
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- toggle ---------- */
.toggle { width: 52px; height: 32px; border-radius: var(--r-pill); background: var(--surface-2); border: none; cursor: pointer; position: relative; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: left .2s; }
.toggle.on { background: var(--ok); }
.toggle.on::after { left: 23px; }

/* ---------- kartlar ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-1);
  width: 300px;
}
.card h3 { font-size: var(--fs-headline); font-weight: 600; }
.card p { color: var(--text-dim); font-size: var(--fs-subhead); margin-top: var(--sp-1); }
.card-elevated { border: none; box-shadow: var(--shadow-3); }
.card-glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: var(--glass-edge), var(--glass-shadow);
}
.card-hero {
  background: var(--grad-accent); color: #fff; border: none; box-shadow: var(--shadow-2);
}
.card-hero p { color: rgba(255,255,255,.75); }

/* stat kartı */
.stat { width: 150px; }
.stat .num { font-size: var(--fs-title1); font-weight: 800; letter-spacing: -.5px; }
.stat .lbl { font-size: var(--fs-footnote); color: var(--text-dim); margin-top: 2px; }
.stat .delta { font-size: var(--fs-footnote); font-weight: 600; color: var(--ok); }

/* liste hücresi (iOS table cell) */
.cells { background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-lg); overflow: hidden; max-width: 340px; }
.cell { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); cursor: pointer; }
.cell + .cell { border-top: 1px solid var(--stroke); }
.cell:active { background: var(--surface-2); }
.cell .ico { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--grad-accent); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.cell .txt { flex: 1; font-size: var(--fs-body); }
.cell .chev { color: var(--text-dim); }

/* progress çubuğu */
.bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; margin-top: var(--sp-3); }
.bar i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--grad-accent); }

/* paywall kartı */
.paywall { width: 300px; text-align: center; border: 1.5px solid var(--accent); position: relative; }
.paywall .badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  background: var(--grad-accent); color: #fff;
  padding: 4px 12px; border-radius: var(--r-pill);
}
.paywall .price { font-size: var(--fs-title1); font-weight: 800; margin-top: var(--sp-3); }
.paywall .per { font-size: var(--fs-footnote); color: var(--text-dim); }
.paywall ul { list-style: none; margin: var(--sp-4) 0; text-align: left; padding: 0; }
.paywall li { font-size: var(--fs-subhead); padding: var(--sp-1) 0; }
.paywall li::before { content: "✓ "; color: var(--ok); font-weight: 700; }

/* ---------- yüzen glass tab bar ---------- */
.tabbar {
  position: absolute; left: var(--inset-float); right: var(--inset-float); bottom: var(--inset-float);
  display: flex; justify-content: space-around; align-items: center;
  height: var(--ctl-lg);
  border-radius: var(--r-pill);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--stroke);
  box-shadow: var(--glass-edge), var(--glass-shadow);
}
.tabbar button {
  font: 600 var(--fs-footnote) var(--font-ui);
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: var(--tap-min); min-height: var(--tap-min); justify-content: center;
}
.tabbar button.on { color: var(--accent); }

/* glass bilgi çipi */
.glass-chip {
  position: absolute; padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg); font-size: var(--fs-subhead); font-weight: 600;
  border: 1px solid var(--stroke);
  box-shadow: var(--glass-edge), var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  color: var(--text);
}

/* ---------- bottom sheet ---------- */
.backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity var(--dur-slow) var(--ease-sheet);
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  background: var(--surface);
  border-radius: var(--r-modal) var(--r-modal) 0 0;
  padding: var(--sp-3) var(--sp-6) calc(var(--sp-8) + env(safe-area-inset-bottom));
  max-width: 640px; margin: 0 auto;
  transform: translateY(105%);
  transition: transform var(--dur-slow) var(--ease-sheet);
  box-shadow: var(--shadow-3);
}
.backdrop.open { opacity: 1; pointer-events: auto; }
.backdrop.open + .sheet { transform: none; }
.grabber { width: 36px; height: 5px; border-radius: var(--r-pill); background: var(--text-dim); opacity: .4; margin: 0 auto var(--sp-4); }

/* ---------- toast ---------- */
.toast {
  position: fixed; top: calc(var(--sp-4) + env(safe-area-inset-top)); left: 50%; z-index: 60;
  transform: translate(-50%, -80px);
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--stroke); border-radius: var(--r-pill);
  padding: var(--sp-3) var(--sp-5);
  font: 600 var(--fs-subhead) var(--font-ui); color: var(--text);
  box-shadow: var(--glass-edge), var(--glass-shadow);
  transition: transform var(--dur-med) var(--ease-spring);
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- win/lose ekranı ---------- */
.result-stage {
  position: relative; border-radius: var(--r-modal); overflow: hidden;
  height: 380px; max-width: 340px;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%), var(--bg);
  border: 1px solid var(--stroke);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-3);
}
.stars { display: flex; gap: var(--sp-2); font-size: 40px; }
.stars span { animation: kk-pop var(--dur-med) var(--ease-spring) both; }
.stars span:nth-child(2) { animation-delay: 120ms; }
.stars span:nth-child(3) { animation-delay: 240ms; }
.stars .off { filter: grayscale(1); opacity: .3; }
.result-title { font-size: var(--fs-title1); font-weight: 800; }
.result-score { font-size: var(--fs-subhead); color: var(--text-dim); }

/* ---------- level ızgarası ---------- */
.lvl-grid { display: grid; grid-template-columns: repeat(5, 56px); gap: var(--sp-3); }
.lvl {
  width: 56px; height: 56px; border-radius: var(--r-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font: 700 var(--fs-body) var(--font-ui); cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--stroke);
  transition: transform var(--dur-instant);
}
.lvl:active { transform: scale(.94); }
.lvl .st { font-size: 9px; letter-spacing: 1px; }
.lvl.done { background: var(--surface-2); }
.lvl.done .st { color: var(--warn); }
.lvl.cur { background: var(--grad-accent); color: #fff; box-shadow: var(--shadow-2); animation: kk-pulse 1.6s var(--ease-out) infinite; }
.lvl.lock { opacity: .35; pointer-events: none; }

/* ---------- oyun HUD ---------- */
.hud-top {
  position: absolute; top: var(--sp-3); left: var(--sp-3); right: var(--sp-3);
  display: flex; justify-content: space-between; align-items: center;
}
.hud-pill {
  display: flex; align-items: center; gap: var(--sp-1);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--stroke); border-radius: var(--r-pill);
  padding: 6px var(--sp-3); font: 700 var(--fs-subhead) var(--font-ui); color: var(--text);
}
.skill {
  position: absolute; right: var(--sp-5); bottom: var(--sp-5);
  width: var(--ctl-xl); height: var(--ctl-xl); border-radius: var(--r-pill);
  border: none; cursor: pointer; font-size: 26px;
  background: var(--grad-accent); color: #fff; box-shadow: var(--shadow-2);
}
.skill .cd {
  position: absolute; inset: 0; border-radius: var(--r-pill);
  background: conic-gradient(rgba(0,0,0,.55) var(--p, 70%), transparent 0);
  pointer-events: none;
}
.combo {
  position: absolute; left: var(--sp-5); bottom: var(--sp-5);
  font: 800 var(--fs-title2) var(--font-ui);
  background: var(--grad-accent); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- ikon ---------- */
.ic { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- telefon çerçevesi ---------- */
.phone {
  width: 320px; height: 640px; border-radius: 44px; overflow: hidden;
  border: 6px solid var(--surface-2); background: var(--bg);
  position: relative; box-shadow: var(--shadow-3);
  display: flex; flex-direction: column;
}

/* ---------- paywall tam sayfa ---------- */
.pw-hero {
  padding: 52px var(--sp-6) var(--sp-5); text-align: center;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 75%);
}
.pw-hero .big { font-size: 52px; }
.pw-hero h3 { font-size: var(--fs-title2); font-weight: 800; margin-top: var(--sp-2); }
.pw-x {
  position: absolute; top: var(--sp-4); right: var(--sp-4);
  width: 30px; height: 30px; border-radius: var(--r-pill); border: none; cursor: pointer;
  background: var(--surface-2); color: var(--text-dim); font-size: 14px;
  opacity: .6; /* paywall X'i kasıtlı silik — standart monetizasyon kalıbı */
}
.pw-feats { padding: 0 var(--sp-6); }
.pw-feats div { display: flex; gap: var(--sp-2); font-size: var(--fs-subhead); padding: var(--sp-1) 0; }
.plans { display: flex; gap: var(--sp-2); padding: var(--sp-4) var(--sp-6) 0; }
.plan {
  flex: 1; border: 1.5px solid var(--stroke); border-radius: var(--r-lg);
  padding: var(--sp-3); text-align: center; cursor: pointer; background: var(--surface);
  color: var(--text); font-family: var(--font-ui); position: relative;
}
.plan.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.plan .badge2 {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 9px; font-weight: 800; letter-spacing: .5px;
  background: var(--grad-accent); color: #fff; padding: 2px 8px; border-radius: var(--r-pill);
}
.plan .p-name { font-size: var(--fs-footnote); font-weight: 700; color: var(--text-dim); }
.plan .p-price { font-size: var(--fs-title3); font-weight: 800; margin-top: 2px; }
.plan .p-sub { font-size: 10px; color: var(--text-dim); }
.pw-cta { padding: var(--sp-4) var(--sp-6); margin-top: auto; }
.pw-restore { text-align: center; font-size: var(--fs-caption); color: var(--text-dim); padding-bottom: var(--sp-5); }

/* ---------- onboarding ---------- */
.ob-track {
  flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.ob-track::-webkit-scrollbar { display: none; }
.ob-slide {
  min-width: 100%; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: var(--sp-8) var(--sp-6); gap: var(--sp-3);
}
.ob-slide .art { font-size: 72px; }
.ob-slide h3 { font-size: var(--fs-title2); font-weight: 800; }
.ob-slide p { font-size: var(--fs-subhead); color: var(--text-dim); line-height: var(--lh-subhead); }
.ob-dots { display: flex; gap: var(--sp-2); justify-content: center; padding: var(--sp-4) 0; }
.ob-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); opacity: .3; transition: all var(--dur-fast) var(--ease-out); }
.ob-dots i.on { opacity: 1; background: var(--accent); width: 20px; border-radius: var(--r-pill); }
.ob-cta { padding: 0 var(--sp-6) var(--sp-6); }

/* ---------- input alanları ---------- */
.field { max-width: 340px; margin-bottom: var(--sp-4); }
.field label { display: block; font-size: var(--fs-footnote); font-weight: 600; color: var(--text-dim); margin-bottom: var(--sp-1); }
.input {
  width: 100%; font: 400 var(--fs-body) var(--font-ui);
  min-height: var(--ctl-md);
  padding: 0 var(--sp-4);
  background: var(--surface); color: var(--text);
  border: 1.5px solid var(--stroke); border-radius: var(--r-md);
  outline: none; transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input::placeholder { color: var(--text-dim); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input.err-state { border-color: var(--err); }
.field .hint { font-size: var(--fs-caption); color: var(--text-dim); margin-top: var(--sp-1); }
.field .hint.err-t { color: var(--err); }
.search {
  display: flex; align-items: center; gap: var(--sp-2);
  max-width: 340px; min-height: 38px;
  padding: 0 var(--sp-3);
  background: var(--surface-2); border-radius: var(--r-md);
  color: var(--text-dim);
}
.search input {
  flex: 1; border: none; outline: none; background: none;
  font: 400 var(--fs-body) var(--font-ui); color: var(--text);
}
.search .ic { width: 18px; height: 18px; }

/* ---------- boş durum + skeleton ---------- */
.empty {
  max-width: 340px; text-align: center;
  padding: var(--sp-10) var(--sp-6);
  border: 1.5px dashed var(--stroke); border-radius: var(--r-lg);
}
.empty .art { font-size: 44px; opacity: .8; }
.empty h3 { font-size: var(--fs-headline); font-weight: 700; margin-top: var(--sp-3); }
.empty p { font-size: var(--fs-subhead); color: var(--text-dim); margin: var(--sp-1) 0 var(--sp-4); }
.skel { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--text) 8%, var(--surface-2)) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: kk-shimmer 1.4s linear infinite; }
@keyframes kk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ---------- mikro rozetler ---------- */
.reldot { position: relative; }
.dot { position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--err); border: 2px solid var(--surface); }
.count {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--err); color: #fff;
  font: 700 11px/18px var(--font-ui); text-align: center;
  border: 2px solid var(--bg);
}
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  padding: 4px var(--sp-3); border-radius: var(--r-pill);
  font: 700 var(--fs-footnote) var(--font-ui);
}
.chip-lvl { background: var(--grad-accent); color: #fff; }
.chip-xp { background: var(--surface-2); color: var(--text); }
.chip-new { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
