:root {
  --bg: #fbf6ec;
  --surface: #ffffff;
  --surface-2: #f4ecdc;
  --ink: #23201b;
  --muted: #6f675a;
  --line: #e7dcc6;
  --accent: #f5b301;
  --accent-ink: #3a2a00;
  --good: #1f9d55;
  --bad: #d64545;
  --der: #2f6fdb;
  --die: #e0456b;
  --das: #1f9d6b;
  --der-soft: #e5eefc;
  --die-soft: #fde7ed;
  --das-soft: #e2f5ec;
  --shadow: 0 1px 2px rgba(60, 45, 20, .06), 0 4px 14px rgba(60, 45, 20, .07);
  --radius: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17150f;
    --surface: #221f18;
    --surface-2: #2c281f;
    --ink: #f3ede1;
    --muted: #a99f8d;
    --line: #3a3529;
    --accent: #f5b301;
    --accent-ink: #2a1f00;
    --good: #3cc47b;
    --bad: #f06a6a;
    --der: #6a9cf0;
    --die: #f27a98;
    --das: #45c493;
    --der-soft: #1d2a42;
    --die-soft: #3d1f29;
    --das-soft: #173628;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17150f; --surface: #221f18; --surface-2: #2c281f; --ink: #f3ede1; --muted: #a99f8d;
  --line: #3a3529; --good: #3cc47b; --bad: #f06a6a; --der: #6a9cf0; --die: #f27a98; --das: #45c493;
  --der-soft: #1d2a42; --die-soft: #3d1f29; --das-soft: #173628; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; padding-top: 24px; padding-bottom: 48px; outline: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 900; font-size: 20px; }
.brand-duck { font-size: 26px; }
.brand-text b { color: var(--accent); margin-left: 2px; }
.nav { display: flex; gap: 4px; }
.nav a {
  text-decoration: none; font-weight: 700; color: var(--muted);
  padding: 8px 12px; border-radius: 999px;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.active { color: var(--accent-ink); background: var(--accent); }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 14px; height: 40px; min-width: 0; flex: 0 1 240px;
}
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; width: 100%; min-width: 0; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .brand { font-size: 18px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .nav a { padding: 6px 10px; font-size: 15px; white-space: nowrap; }
  .search { flex: 1 1 140px; }
}

/* ---------- common ---------- */
h1, h2, h3 { line-height: 1.2; margin: 0; }
.muted { color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface);
  padding: 10px 18px; border-radius: 999px; font-weight: 800; text-decoration: none;
  transition: transform .08s ease, background .15s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-good { background: var(--good); border-color: var(--good); color: #fff; }
.btn-good:hover { background: color-mix(in srgb, var(--good) 88%, #000); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); display: inline-grid; place-items: center; padding: 0;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.on { background: var(--good); border-color: var(--good); color: #fff; }

.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--good); border-radius: inherit; transition: width .3s ease; }

.art { font-weight: 800; }
.art-der { color: var(--der); }
.art-die { color: var(--die); }
.art-das { color: var(--das); }
.badge {
  display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
}

/* ---------- home ---------- */
.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 32px;
}
.hero-main {
  background: var(--accent); color: var(--accent-ink);
  border-radius: 24px; padding: 32px; position: relative; overflow: hidden;
}
.hero-main h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 900; letter-spacing: -.01em; }
.hero-main p { font-size: 18px; margin: 10px 0 20px; max-width: 34ch; }
.hero-main .duck { position: absolute; right: 20px; bottom: -10px; font-size: 120px; opacity: .9; transform: rotate(-8deg); }
.hero-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.hero-stats div { font-weight: 700; }
.hero-stats b { display: block; font-size: 28px; font-weight: 900; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; position: relative; z-index: 1; }
.hero-actions .btn { background: var(--accent-ink); color: var(--accent); border-color: var(--accent-ink); }
.hero-actions .btn.ghost { background: transparent; color: var(--accent-ink); border-color: var(--accent-ink); }

.daily {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px;
}
.daily-label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.daily-icon { font-size: 64px; line-height: 1.1; margin: 6px 0; }
.daily-word { font-size: 28px; font-weight: 900; }
.daily-tr { font-size: 18px; color: var(--muted); }
.daily-actions { margin-top: auto; display: flex; gap: 8px; padding-top: 12px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 24px; font-weight: 900; }

.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.topic-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-decoration: none; display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease;
}
.topic-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.topic-icon { font-size: 38px; line-height: 1; margin-bottom: 8px; }
.topic-de { font-weight: 900; font-size: 18px; }
.topic-tr { color: var(--muted); font-weight: 600; }
.topic-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 10px; margin-bottom: 6px; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-main { padding: 24px; }
  .hero-main .duck { font-size: 80px; right: 10px; }
  .topics { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ---------- topic page ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-weight: 700; margin-bottom: 14px; }
.back:hover { color: var(--ink); }
.topic-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.topic-head .big { font-size: 56px; line-height: 1; }
.topic-head h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 900; }
.topic-head .sub { color: var(--muted); font-weight: 700; font-size: 18px; }
.topic-head .head-progress { margin-left: auto; min-width: 180px; font-size: 14px; font-weight: 700; color: var(--muted); }
.topic-head .head-progress .progress { margin-top: 6px; }

.tabs { display: inline-flex; background: var(--surface-2); padding: 4px; border-radius: 999px; gap: 2px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { text-decoration: none; font-weight: 800; padding: 8px 18px; border-radius: 999px; color: var(--muted); }
.tabs a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; user-select: none; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.legend { display: flex; gap: 12px; margin-left: auto; font-size: 14px; font-weight: 800; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; background: currentColor; }

.words { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.word {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 14px 12px; display: flex; flex-direction: column; align-items: center; text-align: center;
  cursor: pointer; transition: transform .1s ease, border-color .15s ease; box-shadow: var(--shadow);
  border-top: 4px solid var(--line);
}
.word:hover { transform: translateY(-2px); }
.word[data-art="der"] { border-top-color: var(--der); }
.word[data-art="die"] { border-top-color: var(--die); }
.word[data-art="das"] { border-top-color: var(--das); }
.word.is-learned { background: color-mix(in srgb, var(--good) 7%, var(--surface)); }
.word-icon {
  font-size: 44px; line-height: 1; height: 56px; display: grid; place-items: center; margin-bottom: 8px;
}
.word-icon.letter {
  width: 56px; border-radius: 50%; background: var(--surface-2); font-size: 26px; font-weight: 900; color: var(--muted);
}
.word-icon.num { font-size: 40px; font-weight: 900; color: var(--accent); }
.word-de { font-weight: 800; font-size: 18px; line-height: 1.25; word-break: break-word; hyphens: auto; }
.word-tr { color: var(--muted); font-weight: 600; margin-top: 2px; }
.hide-tr .word-tr { visibility: hidden; }
.hide-tr .word:hover .word-tr { visibility: visible; }
.word .badge { margin-top: 6px; }
.word-actions { display: flex; gap: 8px; margin-top: 10px; }
.word-topic { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 6px; text-decoration: none; }
.word-topic:hover { text-decoration: underline; }

/* ---------- flashcards ---------- */
.fc-wrap { max-width: 520px; margin: 0 auto; }
.fc-count { text-align: center; font-weight: 800; color: var(--muted); margin-bottom: 10px; }
.fc { perspective: 1200px; cursor: pointer; height: 340px; }
.fc-inner { position: relative; width: 100%; height: 100%; transition: transform .5s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.fc.flipped .fc-inner { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center;
}
.fc-back { transform: rotateY(180deg); background: var(--surface-2); }
.fc-icon { font-size: 88px; line-height: 1.1; margin-bottom: 12px; }
.fc-icon.num { font-weight: 900; color: var(--accent); }
.fc-de { font-size: 32px; font-weight: 900; line-height: 1.2; }
.fc-tr { font-size: 30px; font-weight: 900; }
.fc-hint { position: absolute; bottom: 14px; font-size: 13px; color: var(--muted); font-weight: 700; }
.fc-controls { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.fc-done { text-align: center; padding: 40px 0; }
.fc-done .big { font-size: 64px; }
.fc-done h2 { margin: 10px 0 8px; font-size: 28px; font-weight: 900; }

/* ---------- quiz ---------- */
.quiz { max-width: 600px; margin: 0 auto; }
.quiz-modes { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 800; font-size: 14px;
}
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.quiz-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.quiz-q {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px 20px; text-align: center;
  box-shadow: var(--shadow); margin: 12px 0 16px;
}
.quiz-q .q-icon { font-size: 72px; line-height: 1.1; }
.quiz-q .q-icon.num { font-weight: 900; color: var(--accent); }
.quiz-q .q-text { font-size: 28px; font-weight: 900; margin-top: 6px; }
.quiz-q .q-help { color: var(--muted); font-weight: 700; margin-top: 4px; }
.listen-btn {
  width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink);
  display: inline-grid; place-items: center; box-shadow: var(--shadow);
}
.listen-btn svg { width: 44px; height: 44px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option {
  background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 16px 12px;
  font-weight: 800; font-size: 17px; text-align: center; transition: border-color .12s ease, background .12s ease;
}
.option:hover:not(:disabled) { border-color: var(--accent); }
.option:disabled { cursor: default; }
.option.correct { background: color-mix(in srgb, var(--good) 15%, var(--surface)); border-color: var(--good); }
.option.wrong { background: color-mix(in srgb, var(--bad) 13%, var(--surface)); border-color: var(--bad); }
.option kbd { display: inline-block; font: inherit; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; margin-right: 6px; }
@media (max-width: 480px) { .options { grid-template-columns: 1fr; } }
.result { text-align: center; padding: 20px 0; }
.result .score { font-size: 64px; font-weight: 900; color: var(--accent); line-height: 1; }
.result h2 { margin: 10px 0; font-size: 26px; font-weight: 900; }
.result ul { list-style: none; padding: 0; margin: 20px auto; max-width: 420px; text-align: left; }
.result li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.result li b { color: var(--bad); }

/* ---------- artikel game ---------- */
.artikel { max-width: 600px; margin: 0 auto; text-align: center; }
.artikel h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 900; }
.artikel .intro { color: var(--muted); font-weight: 600; margin: 6px 0 18px; }
.artikel select {
  font: inherit; font-weight: 700; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
.scoreboard { display: flex; justify-content: center; gap: 28px; margin: 18px 0 8px; font-weight: 800; color: var(--muted); }
.scoreboard b { display: block; font-size: 26px; color: var(--ink); }
.art-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px 20px;
  box-shadow: var(--shadow); margin: 12px 0 18px; transition: background .2s ease;
}
.art-card.ok { background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
.art-card.no { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); }
.art-card .a-icon { font-size: 80px; line-height: 1.1; }
.art-card .a-word { font-size: 34px; font-weight: 900; margin-top: 6px; }
.art-card .a-blank { display: inline-block; min-width: 64px; border-bottom: 3px solid var(--line); margin-right: 8px; }
.art-card .a-tr { color: var(--muted); font-weight: 700; font-size: 18px; }
.art-card .a-feedback { min-height: 26px; font-weight: 800; margin-top: 8px; }
.art-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.art-btn {
  border: 0; border-radius: 16px; padding: 18px 0; font-size: 24px; font-weight: 900; color: #fff;
  transition: transform .08s ease, filter .12s ease;
}
.art-btn:hover:not(:disabled) { filter: brightness(1.08); }
.art-btn:active { transform: scale(.97); }
.art-btn:disabled { opacity: .45; cursor: default; }
.art-btn.der { background: var(--der); }
.art-btn.die { background: var(--die); }
.art-btn.das { background: var(--das); }
.art-btn.pick { opacity: 1; outline: 4px solid var(--ink); outline-offset: 2px; }
.art-tip { margin-top: 22px; font-size: 14px; color: var(--muted); font-weight: 600; }

/* ---------- guide ---------- */
.guide { max-width: 820px; margin: 0 auto; }
.guide h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 900; margin-bottom: 8px; }
.guide > p { color: var(--muted); font-size: 18px; margin-top: 0; }
.guide h2 { font-size: 22px; font-weight: 900; margin: 34px 0 12px; }
.art-explain { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.art-explain div { border-radius: var(--radius); padding: 18px; }
.art-explain .der { background: var(--der-soft); }
.art-explain .die { background: var(--die-soft); }
.art-explain .das { background: var(--das-soft); }
.art-explain b { font-size: 28px; font-weight: 900; display: block; }
.art-explain .der b { color: var(--der); }
.art-explain .die b { color: var(--die); }
.art-explain .das b { color: var(--das); }
@media (max-width: 600px) { .art-explain { grid-template-columns: 1fr; } }
.sound-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.sound-table th, .sound-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.sound-table th { background: var(--surface-2); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sound-table td:first-child { font-weight: 900; font-size: 20px; white-space: nowrap; }
.sound-table tr:last-child td { border-bottom: 0; }
.ex { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 3px 10px 3px 6px; font-weight: 700; margin: 2px 4px 2px 0; }
.ex svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.note { background: var(--surface); border-left: 4px solid var(--accent); padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 14px 0; }
@media (max-width: 600px) { .sound-table th:nth-child(2), .sound-table td:nth-child(2) { display: none; } }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 48px 0; color: var(--muted); font-weight: 700; }
.empty .big { font-size: 56px; }
.site-footer { padding: 24px 16px 32px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 800;
  transition: opacity .2s ease, transform .2s ease; z-index: 50; width: max-content; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
img.emoji { height: 1em; width: 1em; margin: 0 .05em; vertical-align: -0.1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* simgesi olmayan kelimeler için harf rozeti (büyük görünümler) */
.fc-icon.letter, .q-icon.letter, .a-icon.letter {
  width: 110px; height: 110px; margin-left: auto; margin-right: auto; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); color: var(--muted);
  font-size: 52px; font-weight: 900; line-height: 1;
}
.fc-icon.letter { margin-bottom: 16px; }
.fc-back .fc-icon.letter { background: var(--surface); }
