:root{
  --bg:#FAFAFA;
  --bg2:#F0F2F5;
  --card:#FFFFFF;
  --muted:#5F6368;
  --text:#202124;
  --brand:#4285F4;
  --brand2:#3367D6;
  --danger:#D93025;
  --line:#DADCE0;
  --radius:18px;
}
[data-theme="dark"]{
  --bg:#0d0d0f;
  --bg2:#1a1b1e;
  --card:#1f2125;
  --muted:#a4a9b3;
  --text:#f1f1f2;
  --line:#3a3d42;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:var(--bg);color:var(--text)
}

/* Modal FIX */
.modal{
  pointer-events:auto;
  position:fixed; inset:0;
  display:flex; align-items:center; justify-content:center;
  padding:20px; z-index:50;
  background:rgba(0,0,0,.25);
  backdrop-filter:blur(4px);
  animation:modalFade .25s ease;
}
.modal.hidden{
  opacity:0 !important;
  pointer-events:none !important;
  visibility:hidden !important;
}
.modal .inner{
  background:var(--card);
  border-radius:26px;
  padding:16px;
  width:100%; max-width:420px;
  max-height:80vh; overflow:auto;
  box-shadow:0 12px 28px rgba(0,0,0,.18);
  animation:modalSlide .25s ease;
}
@keyframes modalFade { from{opacity:0} to{opacity:1} }
@keyframes modalSlide { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }

.app{
  max-width:520px;
  margin:0 auto;
  min-height:100vh;
  padding:12px 12px 88px;
}
header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 4px 12px;
}
header h1{font-size:22px;margin:0}
header p{margin:4px 0 0;color:var(--muted);font-size:12px}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:0 6px 18px rgba(0,0,0,.08)
}
.card.pad{padding:12px}

.row{display:flex;gap:8px}
.row > *{flex:1}

input,select,button,textarea{
  width:100%;padding:12px;border-radius:12px;
  border:1px solid var(--line);background:#fff;color:var(--text);
  font-size:16px;outline:none
}
button{
  width:100%;padding:12px;border-radius:12px;border:none;
  font-weight:600;cursor:pointer;
  background:linear-gradient(135deg,#3B82F6,#2563EB);
  color:white;box-shadow:0 4px 10px rgba(59,130,246,0.4);
  transition:transform .1s,box-shadow .2s
}
button:hover{box-shadow:0 6px 14px rgba(59,130,246,0.6)}
button:active{transform:scale(.97)}
button.secondary{
  background:linear-gradient(135deg,#10B981,#059669);
  color:white;box-shadow:0 4px 10px rgba(16,185,129,0.4)
}
button.ghost{
  background:transparent;border:1px dashed var(--line);
  color:var(--brand);box-shadow:none
}
button.danger{background:var(--danger)}

.tabs{display:none}
.tabs.active{display:block;animation:fadeUp .25s}
@keyframes fadeUp { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

.list{list-style:none;margin:0;padding:0}
.list li{
  padding:12px;border-top:1px solid var(--line);
  display:flex;justify-content:space-between;align-items:center;gap:8px
}
.list li:first-child{border-top:none}

.word-title{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.word-sub{color:var(--muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.badge{font-size:12px;color:var(--muted)}
.actions{display:flex;gap:6px}



/* ===========================
   Bottom Nav – Light & Dark einheitlich
   =========================== */

.bottom-nav{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  padding:8px 12px calc(8px + env(safe-area-inset-bottom));
  background:linear-gradient(180deg, transparent, rgba(0,0,0,0.08));
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  z-index:40;
}

[data-theme="dark"] .bottom-nav{
  background:linear-gradient(180deg, transparent, rgba(0,0,0,0.45));
}

.bottom-nav .wrap{
  max-width:520px;
  margin:0 auto;
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:6px;
  padding:4px;
  background:var(--card);
  border-radius:999px;
  border:1px solid var(--line);
  box-shadow:0 10px 30px rgba(0,0,0,0.22);
}

/* Nav-Buttons */

.nav-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  padding:8px 4px;
  border-radius:999px;
  font-size:11px;
  color:var(--muted);
  cursor:pointer;
  transition:
    background .15s ease,
    color .15s ease,
    transform .1s ease,
    box-shadow .15s ease;
  opacity:1;
}

.nav-btn i{
  font-size:15px;
}

.nav-btn.active{
  background:var(--brand);
  color:#fff;
  transform:translateY(-1px);
  box-shadow:0 6px 16px rgba(0,0,0,0.25);
}

[data-theme="dark"] .nav-btn.active{
  box-shadow:0 6px 20px rgba(0,0,0,0.6);
}



.mc-option{
  padding:16px;border:1px solid var(--line);
  background:var(--card);border-radius:18px;
  cursor:pointer;transition:.2s;
  box-shadow:0 2px 6px rgba(0,0,0,.08)
}
.mc-option:hover{background:#eef4ff}
.mc-option.selected{
  background:#eef4ff;border-color:var(--brand);
  box-shadow:0 0 0 3px rgba(66,133,244,.22);
  transform:translateY(-1px)
}
.mc-option.correct{
  background:rgba(52,199,89,.14)!important;
  border-color:#34C759!important;
  box-shadow:0 0 0 2px rgba(52,199,89,.35)
}
.mc-option.wrong{
  background:rgba(255,59,48,.12)!important;
  border-color:#FF3B30!important;
  box-shadow:0 0 0 2px rgba(255,59,48,.32)
}
.mc-option.dim{opacity:.45;filter:saturate(.2)}


.mc-settings {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 10px 6px;
}

.mc-settings-row {
  display: contents;
}

.mc-settings label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
}

/* --- TEIL 2 START --- */

.profile-avatar{
  width:54px;height:54px;border-radius:16px;
  display:grid;place-items:center;
  font-size:30px;background:var(--bg2);
  box-shadow:inset 0 0 0 1px var(--line)
}
.level-bar{height:10px;background:var(--bg2);border-radius:999px;overflow:hidden}
.level-bar>div{height:100%;background:linear-gradient(90deg,#3B82F6,#10B981)}
.badge-pill{
  padding:8px 10px;border-radius:999px;border:1px solid var(--line);
  font-size:12px;text-align:center;background:var(--card)
}
.badge-pill.locked{opacity:.45;filter:grayscale(1)}
.avatar-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-top:8px}
.avatar-btn{
  background:var(--bg2);border-radius:12px;padding:10px;text-align:center;
  font-size:22px;cursor:pointer;box-shadow:inset 0 0 0 1px var(--line)
}

/* ⭐ NEUES PROFIL-LAYOUT (eleganter, einheitlicher) */
.profile-card-shell{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.profile-main-row{
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.profile-main-info{
  flex:1;
  min-width:0;
}
.profile-name-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
}
.profile-name{
  font-weight:700;
  font-size:15px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.profile-level-chip{
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  background:var(--bg2);
  color:var(--brand2);
}
.profile-subline{
  margin-top:2px;
  font-size:12px;
  color:var(--muted);
}
.profile-progress-wrap{
  margin-top:8px;
}
.profile-stats-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.hidden{display:none!important}
.small{font-size:12px}
.title{font-weight:800;font-size:16px}

@supports (-webkit-backdrop-filter:none) {
  .modal,.bottom-nav{
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }
}

.statTabs {
  display:flex;
  gap:6px;
  margin-bottom:10px;
}
.statTab {
  flex:1;
  padding:10px;
  background:var(--bg2);
  text-align:center;
  border-radius:12px;
  font-weight:600;
  cursor:pointer;
  color:var(--muted);
}
.statTab.active {
  background:var(--brand);
  color:white;
}

.statPage { display:none; }
.statPage.active { display:block; }

.grid3 {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
}
.statCard {
  background:var(--bg2);
  padding:10px;
  border-radius:14px;
  text-align:center;
  font-weight:600;
}
.statBadge {
  background:var(--card);
  border:1px solid var(--line);
  border-radius:12px;
  padding:6px;
  text-align:center;
}
.label {
  font-size:11px;
  color:var(--muted);
}

/* Einstellungen – Dark-Mode-Reihe */
.settings-toggle-row{
  margin-top:12px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
}

.settings-toggle-row span{
  flex:0 0 auto;
}

.settings-toggle-row label{
  display:flex;
  align-items:center;
}

.settings-toggle-row input[type="checkbox"]{
  width:22px;
  height:22px;
  accent-color: var(--brand);
}

/* Einstellungen & Sprachpaare kombiniert */
.settings-section{
  margin-top:8px;
}
.settings-divider{
  margin:12px -12px 0;
  border-top:1px solid var(--line);
}

/* Onboarding Wizard v3 (mobil) */
.onb-overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:70;
  background:rgba(15,23,42,0.5);
  backdrop-filter:blur(6px);
}
.onb-overlay.hidden{
  display:none!important;
}

.onb-shell{
  width:100%;
  max-width:540px;
  display:flex;
  flex-direction:row;
  border-radius:24px;
  overflow:hidden;
  background:var(--card);
  box-shadow:0 20px 45px rgba(15,23,42,0.45);
}

/* linke Story-Spalte */
.onb-left{
  flex:1.1;
  padding:16px 16px 14px;
  background:linear-gradient(135deg,#0EA5E9,#6366F1);
  color:#E5E7EB;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.onb-logoRow{
  display:flex;
  align-items:center;
  gap:10px;
}
.onb-logoEmoji{
  width:36px;
  height:36px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:rgba(15,23,42,0.25);
  font-size:22px;
}
.onb-appTitle{
  font-weight:700;
  font-size:14px;
}
.onb-chip{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  background:rgba(15,23,42,0.28);
  font-size:11px;
}
.onb-headline{
  font-weight:800;
  font-size:18px;
}
.onb-subline{
  font-size:13px;
  line-height:1.4;
}
.onb-benefits{
  margin-top:4px;
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:12px;
}
.onb-benefit-row{
  display:flex;
  gap:6px;
}
.onb-left-footer{
  margin-top:auto;
  font-size:11px;
  opacity:.9;
  display:flex;
  flex-direction:column;
  gap:2px;
}

/* rechte Wizard-Spalte */
.onb-right{
  flex:1;
  padding:16px;
  background:var(--card);
  display:flex;
  flex-direction:column;
  gap:10px;
}
.onb-step-indicator{
  display:flex;
  gap:6px;
  margin-bottom:4px;
}
.onb-step-dot{
  width:18px;
  height:6px;
  border-radius:999px;
  background:var(--bg2);
  opacity:.6;
}
.onb-step-dot.active{
  background:var(--brand);
  opacity:1;
}
.onb-step{
  display:none;
}
.onb-step.active{
  display:block;
}
.onb-step-label{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--muted);
  margin-bottom:4px;
}
.onb-step-title{
  font-weight:700;
  font-size:16px;
  margin-bottom:4px;
}
.onb-step-sub{
  font-size:13px;
  color:var(--muted);
  margin-bottom:10px;
}
.onb-field{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:12px;
}
.onb-input{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  font-size:15px;
}
.onb-actions{
  display:flex;
  gap:8px;
  margin-top:4px;
}
.onb-btn{
  flex:1;
  border-radius:999px;
  padding:9px 12px;
  font-size:14px;
  font-weight:600;
  border:none;
  cursor:pointer;
}
.onb-btn-primary{
  background:linear-gradient(135deg,#3B82F6,#2563EB);
  color:#fff;
}
.onb-btn-primary:disabled{
  opacity:.4;
  cursor:default;
}
.onb-btn-ghost{
  background:transparent;
  border:1px dashed var(--line);
  color:var(--brand);
}

/* Sprachpaar-Karten */
.onb-pair-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  margin:10px 0;
}
.onb-pair-card{
  border-radius:16px;
  border:1px solid var(--line);
  padding:10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  cursor:pointer;
  background:var(--bg2);
  transition:.15s;
}
.onb-pair-main{
  min-width:0;
}
.onb-pair-title{
  font-weight:600;
  font-size:14px;
}
.onb-pair-sub{
  font-size:12px;
  color:var(--muted);
}
.onb-pill{
  font-size:11px;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(15,118,110,.1);
  color:#0f766e;
  white-space:nowrap;
}
.onb-pair-card.selected{
  border-color:var(--brand);
  background:#e0ecff;
  box-shadow:0 0 0 2px rgba(59,130,246,.35);
}

/* mobile stacking */
@media (max-width:640px){
  .onb-shell{
    flex-direction:column;
  }
  .onb-left{
    border-bottom:1px solid rgba(148,163,184,.35);
  }
}

body.no-scroll-onb{
  overflow:hidden;
}

/* Testmodi Toggle im Schreibtest */
.test-mode-toggle{
  display:flex;
  gap:6px;
  margin-top:4px;
}
.test-mode-btn{
  flex:1;
  font-size:12px;
  padding:6px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--bg2);
  color:var(--muted);
  cursor:pointer;
}
.test-mode-btn.active{
  background:var(--brand);
  color:#fff;
  border-color:var(--brand2);
}

/* Globaler Banner für Erfolg/Fehler (z.B. Backup) */
.banner{
  position:fixed;
  top:12px;
  left:50%;
  transform:translate(-50%,-10px);
  background:#16a34a;
  color:#fff;
  padding:8px 14px;
  border-radius:999px;
  font-size:13px;
  z-index:80;
  box-shadow:0 8px 20px rgba(0,0,0,0.25);
  opacity:0;
  pointer-events:none;
  transition:opacity .25s ease, transform .25s ease;
}
.banner.show{
  opacity:1;
  transform:translate(-50%,0);
  pointer-events:auto;
}
.banner.error{
  background:#dc2626;
}

.muted{
  color:var(--muted);
}

/* UI Language Switch (DE / TR) */
#uiLangToggle{
  display:flex;
  gap:6px;
  margin-top:4px;
}
#uiLangToggle .chip-lang{
  width:auto;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--bg2);
  color:var(--muted);
  font-size:11px;
  cursor:pointer;
  box-shadow:none;
}
#uiLangToggle .chip-lang-active{
  background:var(--brand);
  color:#fff;
  border-color:var(--brand2);
}
#uiLangToggle .chip-lang:hover{
  box-shadow:none;
  transform:none;
}


/* Container – garantiert nebeneinander */
.lang-chip-wrap {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 6px;
}

/* Grundstil der Chips */
.lang-chip {
    display: flex !important;
    align-items: center;
    justify-content: center;

    padding: 0 10px;
    height: 28px;

    border-radius: 999px;
    cursor: pointer;

    background: #e5e7eb;  /* sichtbarer Hintergrund für nicht-aktive Chips */
    color: #374151;
    font-size: 13px;
    font-weight: 600;

    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

/* Hover */
.lang-chip:hover {
    background: #d1d5db;
}

/* Aktiver Chip */
.lang-chip.active {
    background: #2563eb;
    color: white;
    box-shadow: 0 0 6px rgba(37, 99, 235, .35);
}











/* Sprachumschalter Wrapper */
.lang-switch {
    display: flex;
    gap: 6px;
}

/* Rechteckige Soft-UI Buttons */
.lang-btn {
    min-width: 38px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;

    background: #f1f5f9; /* light gray */
    color: #374151;

    border-radius: 6px; /* NICHT rund */
    transition: 0.15s ease-in-out;

    /* Soft-UI Effekt */
    box-shadow:
        2px 2px 4px rgba(0,0,0,0.12),
        -2px -2px 4px rgba(255,255,255,0.9);
}

.lang-btn:hover {
    background: #e2e8f0;
}

/* Aktiver Button → blau + Glow */
.lang-btn.active {
    background: #2563eb;
    color: white;
    box-shadow:
        0 0 8px rgba(37,99,235,0.45);
}

/* Mobile etwas kleiner */
@media (max-width: 500px) {
    .lang-btn {
        padding: 4px 8px;
        font-size: 11px;
        min-width: 34px;
    }
}




.ios-lang-toggle {
  position: relative;
  width: 85px;
  height: 30px;
  background: var(--bg, #e7e7e7);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px;
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.15),
    inset 0 -1px 2px rgba(255,255,255,0.9);
  user-select: none;
  touch-action: pan-x;
}

.ios-slider {
  position: absolute;
  width: 40px;
  height: 22px;
  border-radius: 16px;
  background: linear-gradient(135deg,#4A6BFF,#3E5EFF);
  top: 4px;
  left: 4px;
  transition: left .25s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.ios-opt {
  flex: 1;
  text-align: center;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  color: #666;
  transition: color .25s;
}

.ios-opt.active {
  color: white;
}

/* Dark Mode */
[data-theme="dark"] .ios-lang-toggle {
  --bg: #1f2937;
}







/* ===== HEADER TITLE FIX (Einzelzeile) ===== */

.header-row {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.header-title-block {
    flex: 1;
    min-width: 0;         /* WICHTIG, damit nowrap funktioniert */
}

/* Titel nur 1 Zeile */
header h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Subtitle ebenfalls einzeilig */
#appSubtitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}







/* Mini Besucher Counter (Icon + Zahl) */
.visit-counter {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 11px;
    color: var(--muted);
    opacity: .75;
}

.visit-counter i {
    font-size: 12px;
    opacity: .7;
}

.visit-counter__value {
    font-weight: 600;
    font-size: 12px;
    color: var(--text);
    min-width: 14px;
    transition: transform .25s ease, opacity .25s ease;
}

/* Bounce-Effekt bei neuer Zahl */
.visit-counter.bump .visit-counter__value {
    transform: scale(1.25);
    opacity: 1;
}


