/* =========================================================================
   Oxford Learner — Tasarım sistemi (rafine koyu, modern minimal)
   ========================================================================= */
:root {
  /* Zemin & yüzeyler */
  --bg: #0b0e16;
  --bg-soft: #0f131d;
  --surface: #141925;
  --surface-2: #1b2130;
  --surface-3: #232b3c;

  /* Çizgiler */
  --border: #232a3a;
  --border-strong: #303950;

  /* Metin */
  --text: #e7e9f1;
  --text-dim: #aeb5c7;
  --muted: #7a8298;

  /* Vurgu (tek ana renk) */
  --primary: #6d8bff;
  --primary-strong: #5a78f5;
  --primary-soft: rgba(109, 139, 255, .14);

  /* Semantik */
  --green: #34d39a;
  --green-soft: rgba(52, 211, 154, .13);
  --red: #f4677a;
  --red-soft: rgba(244, 103, 122, .13);
  --amber: #f7b94a;
  --amber-soft: rgba(247, 185, 74, .13);

  /* Şekil */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  /* Gölge */
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, .65);
  --shadow-sm: 0 6px 18px -10px rgba(0, 0, 0, .5);

  /* Tipografi */
  --font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Reset & temel ---- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(109, 139, 255, .10), transparent 60%),
    radial-gradient(700px 500px at -10% 0%, rgba(52, 211, 154, .05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.25; }
a { color: inherit; }
::selection { background: var(--primary-soft); }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft); border-radius: 8px; }

/* ---- Yardımcılar ---- */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* =========================================================================
   Üst bar / navigasyon
   ========================================================================= */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.5rem;
  background: rgba(15, 19, 29, .72);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 800; font-size: 1.08rem; letter-spacing: -.02em; }
.nav { display: flex; align-items: center; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 500;
  padding: .4rem .7rem; border-radius: var(--radius-pill); margin-left: .25rem;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }

/* =========================================================================
   Düzen
   ========================================================================= */
.container { max-width: 960px; margin: 0 auto; padding: 2rem 1.3rem 5rem; }
.container.narrow { max-width: 600px; }
.container > h1 { font-size: 1.7rem; font-weight: 800; margin: 0 0 1.4rem; }
.container > h1 + .muted { margin-top: -1rem; }

/* =========================================================================
   Butonlar
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  cursor: pointer; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: .65rem 1.15rem; font-family: inherit; font-size: .92rem; font-weight: 600;
  background: var(--surface-2); color: var(--text); text-decoration: none;
  transition: transform .06s ease, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 8px 20px -10px var(--primary);
}
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn-lg { padding: .9rem 1.7rem; font-size: 1.02rem; margin-top: 1.3rem; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { filter: brightness(1.05); }

/* =========================================================================
   Kartlar / istatistik kutuları
   ========================================================================= */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2.2rem; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem;
}
.stat { text-align: center; transition: transform .14s ease, border-color .15s, box-shadow .15s; }
.stat:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.stat-icon { font-size: 1.6rem; line-height: 1; margin-bottom: .4rem; opacity: .95; }
.stat-num { font-size: 1.95rem; font-weight: 800; color: var(--primary); letter-spacing: -.02em; }
.stat-label { color: var(--muted); font-size: .82rem; margin-top: .25rem; }
#due-count { color: var(--amber); }
#today-count { color: var(--primary); }
#learned-count { color: var(--green); }
#total-count { color: var(--text); }

/* =========================================================================
   Hero (panel üstü)
   ========================================================================= */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(130% 150% at 100% 0%, rgba(109, 139, 255, .18), transparent 55%),
    linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.2rem; margin-bottom: 1.6rem;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 2rem; flex-wrap: wrap;
}
.hero-main { flex: 1; min-width: 240px; }
.hero h1 { margin: 0 0 .45rem; font-size: 1.7rem; font-weight: 800; }
.hero-chips { display: flex; gap: .5rem; margin-bottom: .9rem; }
.hero-chip {
  background: rgba(255, 255, 255, .05); border: 1px solid var(--border-strong);
  padding: .28rem .75rem; border-radius: var(--radius-pill);
  font-size: .82rem; font-weight: 600;
}

/* XP ilerleme çubuğu */
.hero-xp { margin: 1.2rem 0 1.4rem; }
.hero-xp-bar { height: 9px; background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }
.hero-xp-fill {
  height: 100%; width: 0; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), #9db3ff);
  transition: width .6s ease;
}
.hero-xp-text { display: block; margin-top: .45rem; }

/* Günlük hedef halkası */
.hero-ring { position: relative; width: 134px; height: 134px; flex: none; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.ring-fg {
  fill: none; stroke: var(--amber); stroke-width: 9; stroke-linecap: round;
  transition: stroke-dashoffset .7s ease;
}
.ring-label {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .05rem;
}
#ring-pct { font-size: 1.35rem; font-weight: 800; color: var(--amber); }

/* =========================================================================
   Seviye çubukları (dashboard + stats)
   ========================================================================= */
.levels { margin-bottom: 2.2rem; }
.levels h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 1rem; }
.level-bars { display: flex; flex-direction: column; gap: .75rem; }
.level-row { display: flex; align-items: center; gap: .9rem; }
.level-tag { width: 32px; font-weight: 700; color: var(--text-dim); font-size: .9rem; }
.level-track { flex: 1; height: 10px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.level-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #9db3ff); border-radius: var(--radius-pill); transition: width .5s ease; }
.level-val { width: 110px; text-align: right; color: var(--muted); font-size: .8rem; }

/* Geçmiş grafiği */
.history-chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.hist-bar { flex: 1; background: linear-gradient(180deg, var(--primary), var(--primary-strong)); border-radius: 5px 5px 0 0; min-height: 4px; opacity: .8; transition: opacity .15s; }
.hist-bar:hover { opacity: 1; }

/* =========================================================================
   Panel (çalışma & sonuç ekranları)
   ========================================================================= */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.2rem; box-shadow: var(--shadow);
  text-align: center;
}
.panel h2 { font-size: 1.3rem; font-weight: 800; }
.badge {
  display: inline-block; background: var(--primary-soft); color: var(--primary);
  padding: .2rem .7rem; border-radius: var(--radius-pill); font-size: .76rem;
  font-weight: 700; letter-spacing: .02em; margin-bottom: 1.1rem;
}

/* Kelime kartı tipografisi */
.word { font-size: 2.5rem; font-weight: 800; letter-spacing: -.02em; }
.phon { color: var(--muted); font-size: 1.1rem; margin: .25rem 0; }
.pos { color: var(--amber); font-style: italic; margin-bottom: 1rem; }

.actions { margin-top: 1.6rem; display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }

/* =========================================================================
   Çalışma: mod seçimi
   ========================================================================= */
.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.6rem; }
.mode-card {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 1.5rem 1rem; cursor: pointer; font-family: inherit;
  transition: transform .1s ease, border-color .15s, background .15s, box-shadow .15s;
}
.mode-card:hover {
  border-color: var(--primary); background: var(--surface-3);
  transform: translateY(-3px); box-shadow: var(--shadow-sm);
}
.mode-icon { font-size: 2rem; }
.mode-name { font-weight: 700; font-size: 1.05rem; }
.mode-desc { color: var(--muted); font-size: .82rem; text-align: center; }

/* =========================================================================
   Çalışma: oturum üst bilgisi + ilerleme
   ========================================================================= */
.study { max-width: 660px; }
.progress-wrap { margin-bottom: 1.4rem; }
.session-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .55rem; }
.xp-tag { color: var(--amber); font-weight: 700; font-size: .9rem; }
.exit-btn {
  background: transparent; border: 1px solid var(--border-strong); color: var(--muted);
  padding: .35rem .8rem; border-radius: var(--radius-pill); font-family: inherit;
  font-size: .82rem; font-weight: 600; cursor: pointer; transition: color .15s, border-color .15s;
}
.exit-btn:hover { color: var(--red); border-color: var(--red); }
.progress-bar { height: 8px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), #6ee7b7); transition: width .35s ease; }
#session-meta { margin-top: .45rem; text-align: right; }

.goal-banner {
  background: var(--green-soft); border: 1px solid var(--green); color: var(--text);
  padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem;
  text-align: center; font-weight: 600; font-size: .9rem; cursor: pointer;
  animation: bannerIn .3s ease;
}
@keyframes bannerIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.audio-btn { margin-bottom: 1.1rem; }

/* =========================================================================
   Çalışma: çoktan seçmeli & yazarak
   ========================================================================= */
.q-prompt { font-size: 1.25rem; font-weight: 600; margin-bottom: 1.5rem; white-space: pre-line; }
.options { display: grid; gap: .65rem; }
.option {
  display: flex; align-items: center; gap: .1rem;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: .9rem 1rem; border-radius: var(--radius-sm); cursor: pointer; text-align: left;
  font-family: inherit; font-size: .96rem; transition: background .15s, border-color .15s, transform .06s;
}
.option:hover { background: var(--surface-3); border-color: var(--primary); }
.option:active { transform: translateY(1px); }
.option.correct { background: var(--green-soft); border-color: var(--green); }
.option.wrong { background: var(--red-soft); border-color: var(--red); }
.option:disabled { cursor: default; }
.opt-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.55rem; height: 1.55rem; margin-right: .65rem; flex: none;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px;
  font-size: .78rem; font-weight: 700; color: var(--muted);
}
.option.correct .opt-num { border-color: var(--green); color: var(--green); }
.option.wrong .opt-num { border-color: var(--red); color: var(--red); }

.q-input {
  width: 100%; padding: .9rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font-family: inherit; font-size: 1rem; margin-bottom: 1rem;
}
.q-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* Kelime dizme (harf taşları) */
.scramble-slots {
  display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center;
  min-height: 3.2rem; margin-bottom: 1.4rem;
}
.scramble-slot {
  width: 2.7rem; height: 3rem; border: 2px dashed var(--border-strong); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; font-weight: 800;
}
.scramble-slot.filled {
  border-style: solid; border-color: var(--primary); background: var(--surface-2);
  cursor: pointer;
}
.scramble-pool { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.scramble-tile {
  width: 2.9rem; height: 3.1rem; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface-2); color: var(--text); font-family: inherit;
  font-size: 1.35rem; font-weight: 800; cursor: pointer;
  transition: transform .08s, background .15s, opacity .15s;
}
.scramble-tile:hover { background: var(--surface-3); }
.scramble-tile:active { transform: translateY(1px); }
.scramble-tile.used { opacity: .2; pointer-events: none; }

.feedback { margin-top: 1.3rem; padding: 1.1rem; border-radius: var(--radius-sm); text-align: left; }
.feedback.ok { background: var(--green-soft); border: 1px solid var(--green); }
.feedback.no { background: var(--red-soft); border: 1px solid var(--red); }
.feedback .ai { margin-top: .7rem; line-height: 1.75; }
.feedback .ai .example,
.feedback .example { color: var(--muted); font-style: italic; }
.ai-word { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: .35rem; }
.ai-word > strong { font-size: 1.08rem; }

/* Okunuş dinleme butonu */
.speak-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; padding: 0; flex: none;
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface-2); color: var(--text); cursor: pointer; font-size: .95rem;
  transition: background .15s, border-color .15s, transform .08s;
}
.speak-btn:hover { background: var(--surface-3); border-color: var(--primary); }
.speak-btn:active { transform: translateY(1px); }

/* Eşleştirmede dokununca okunan kelime taşı */
.match-item.speakable { cursor: pointer; }
.tile-speak { opacity: .7; font-size: .9em; }

/* =========================================================================
   Çalışma: eşleştirme (sürükle-bağla)
   ========================================================================= */
.match-area { position: relative; margin-top: .5rem; touch-action: none; }
.match-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }
.match-line { stroke-width: 3; stroke-linecap: round; }
.match-line.temp { stroke: var(--primary); stroke-dasharray: 6 5; }
.match-line.done { stroke: var(--green); }
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.6rem; position: relative; z-index: 1; }
.match-col { display: flex; flex-direction: column; gap: .65rem; }
.match-item {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: .85rem; border-radius: var(--radius-sm); cursor: grab; font-size: .94rem;
  text-align: center; user-select: none; touch-action: none;
  transition: background .15s, border-color .15s, transform .08s;
}
.match-item:hover { border-color: var(--primary); }
.match-item.selected { border-color: var(--primary); background: var(--surface-3); transform: scale(1.03); }
.match-item.paired { background: var(--green-soft); border-color: var(--green); cursor: default; }
.match-item.shake-wrong { border-color: var(--red); background: var(--red-soft); animation: shake .4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* =========================================================================
   Oturum sonu + rozetler
   ========================================================================= */
.done-xp { font-size: 1.35rem; font-weight: 800; color: var(--amber); margin: .9rem 0; }
.badge-row { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin: 1.1rem 0; }
.badge-chip {
  background: var(--amber-soft); border: 1px solid var(--amber); color: var(--text);
  padding: .35rem .9rem; border-radius: var(--radius-pill); font-weight: 600;
}

/* İstatistik: XP başlığı */
.xp-hero {
  background:
    radial-gradient(130% 150% at 100% 0%, rgba(247, 185, 74, .14), transparent 55%),
    linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; margin-bottom: 1.6rem; box-shadow: var(--shadow);
}
.xp-hero-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .65rem; }
.xp-level { font-size: 1.45rem; font-weight: 800; color: var(--amber); }
.xp-bar { height: 11px; background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }
.xp-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), #ffd584); border-radius: var(--radius-pill); transition: width .6s ease; }

/* Rozet ızgarası */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: .85rem; }
.badge-tile {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem .7rem; transition: transform .14s ease, border-color .15s;
}
.badge-tile.earned { border-color: var(--amber); background: var(--amber-soft); }
.badge-tile.earned:hover { transform: translateY(-3px); }
.badge-tile.locked { opacity: .45; }
.badge-tile-icon { font-size: 1.9rem; }
.badge-tile-name { font-weight: 700; font-size: .88rem; }
.badge-tile-desc { color: var(--muted); font-size: .73rem; line-height: 1.4; }

/* =========================================================================
   Formlar (ayarlar)
   ========================================================================= */
.form-group { margin-bottom: 1.4rem; }
.form-group > label { display: block; margin-bottom: .45rem; font-weight: 600; }
.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="password"],
.form-group select {
  width: 100%; padding: .75rem .95rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font-family: inherit; font-size: 1rem;
}
.form-group input:focus,
.form-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.checks { display: flex; gap: 1rem; flex-wrap: wrap; }
.checks label {
  display: inline-flex; align-items: center; gap: .4rem; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border); padding: .5rem .9rem;
  border-radius: var(--radius-pill); cursor: pointer; transition: border-color .15s;
}
.checks label:hover { border-color: var(--border-strong); }
.checks input { accent-color: var(--primary); }
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* Ayar bölümleri (kart gruplar) */
.settings-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.3rem;
}
.settings-group h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 1.2rem; }
.settings-group .form-group:last-child { margin-bottom: 0; }
.form-group label.switch-label {
  display: inline-flex; align-items: center; gap: .6rem; font-weight: 500; cursor: pointer;
}
.form-group label.switch-label input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }

/* =========================================================================
   Hız Turu (arcade) — HUD, kalpler, timer, combo
   ========================================================================= */
.game-hud { position: relative; margin-bottom: 1.3rem; }
.hud-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: .55rem; }
.hud-hearts { font-size: 1.15rem; letter-spacing: 3px; }
.hud-combo { color: var(--amber); font-weight: 800; font-size: .95rem; min-width: 60px; text-align: center; }
.hud-score { font-weight: 800; font-size: 1.3rem; color: var(--primary); letter-spacing: -.02em; }
.hud-timer { height: 8px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.hud-timer-bar {
  height: 100%; width: 100%; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--red), var(--amber) 45%, var(--green));
}
.score-pop {
  position: absolute; right: .4rem; top: 1.9rem; pointer-events: none;
  color: var(--green); font-weight: 800; font-size: 1.15rem;
  animation: scorePop .75s ease forwards;
}
@keyframes scorePop {
  0% { opacity: 0; transform: translateY(8px) scale(.8); }
  20% { opacity: 1; transform: translateY(0) scale(1.12); }
  100% { opacity: 0; transform: translateY(-24px) scale(1); }
}
.mode-card-game { border-color: rgba(247, 185, 74, .4); }
.mode-card-game:hover { border-color: var(--amber); }
.mode-card-game .mode-name { color: var(--amber); }

/* =========================================================================
   Marka logosu
   ========================================================================= */
.brand { display: flex; align-items: center; gap: .55rem; }
.brand-mark { width: 26px; height: 26px; flex: none; }

/* =========================================================================
   Footer (kaynak / atıf)
   ========================================================================= */
.site-footer {
  max-width: 960px; margin: 0 auto; padding: 1.6rem 1.3rem 2.6rem;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: .8rem; line-height: 1.65; text-align: center;
}
.site-footer strong { color: var(--text-dim); font-weight: 600; }

/* =========================================================================
   Duyarlı (mobil)
   ========================================================================= */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .topbar { flex-wrap: wrap; gap: .4rem .2rem; padding: .7rem 1rem; }
  .brand { font-size: 1rem; }
  .nav { flex-wrap: wrap; }
  .nav a { margin-left: 0; margin-right: .15rem; padding: .35rem .6rem; font-size: .88rem; }

  .container { padding: 1.4rem .95rem 3.5rem; }
  .container > h1 { font-size: 1.45rem; }
  .panel { padding: 1.4rem 1.15rem; }

  .hero { padding: 1.5rem 1.3rem; justify-content: center; gap: 1.3rem; }
  .hero h1 { font-size: 1.4rem; }
  .hero-ring { width: 114px; height: 114px; }

  .cards { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .card { padding: 1rem; }
  .stat-num { font-size: 1.6rem; }

  .mode-grid { grid-template-columns: 1fr; gap: .75rem; }
  .mode-card { flex-direction: row; gap: .9rem; text-align: left; padding: 1.1rem; }
  .mode-icon { font-size: 1.7rem; }
  .mode-desc { text-align: left; }

  .word { font-size: 2.1rem; }
  .q-prompt { font-size: 1.12rem; }

  .match-grid { gap: 1.6rem; }
  .match-item { padding: .8rem .55rem; font-size: .9rem; }

  .badge-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .65rem; }
  .xp-hero { padding: 1.2rem; }
  .xp-level { font-size: 1.25rem; }

  .btn-lg { width: 100%; }

  /* Mobilde "Devam" butonu ekranın altına sabit — başparmakla tek dokunuş,
     içeriğe uzanmaya / kaydırmaya gerek yok */
  .btn-next:not(.hidden) {
    position: fixed; left: 14px; right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: auto; justify-content: center; z-index: 40; margin: 0;
    padding: 1.05rem; font-size: 1.06rem; border-radius: 14px;
    box-shadow: 0 14px 34px -8px rgba(0, 0, 0, .7);
    animation: nextRise .22s ease;
  }
  @keyframes nextRise { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  /* sabit buton son satırı örtmesin */
  .container.study { padding-bottom: 6.5rem; }
}

@media (max-width: 400px) {
  .cards { grid-template-columns: 1fr; }
  .word { font-size: 1.8rem; }
  .match-grid { gap: 1.1rem; }
}
