/* ─────────────────────────────────────────────────────────────
   LINGO NONI II — Designsystem (Web-Port von theme.jsx)
   Italienisch warm, Aubergine #3d2540 als Marken-Anker.
   Quelle: design_handoff_lingo_noni/theme.jsx + README.
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..600;1,9..144,300..600&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Marke */
  --aubergine:       #3d2540;
  --aubergine-deep:  #2a1830;
  --aubergine-soft:  #5a3a60;
  --accent:          var(--aubergine); /* Default-Accent, per Tweak überschreibbar */

  /* Warme Neutrale — sun-baked */
  --cream:        #f6f1e8;
  --cream-deep:   #ede4d3;
  --paper:        #fbf8f1;
  --ink:          #1c1019;
  --ink-soft:     #4a3a44;
  --ink-mute:     rgba(28, 16, 25, 0.55);
  --ink-faint:    rgba(28, 16, 25, 0.35);
  --ink-hair:     rgba(28, 16, 25, 0.10);

  /* Akzente — italienisch */
  --terracotta:   #c46a4a;
  --saffron:      #dca34a;
  --basil:        #6e8d4e;
  --lagoon:       #4a8a8e;
  --rosa:         #d99a92;

  /* Surface-Mappings (light = default) */
  --bg:           var(--cream);
  --surface:      var(--paper);
  --surface-alt: var(--cream-deep);

  /* Type */
  --font-display: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --font-ui:      "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* Shadows */
  --shadow-card:    0 1px 0 rgba(255, 255, 255, 0.6),
                    0 1px 2px rgba(61, 37, 64, 0.06),
                    0 8px 28px rgba(61, 37, 64, 0.07);
  --shadow-primary: 0 4px 14px rgba(61, 37, 64, 0.25),
                    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  --shadow-fab:     0 6px 18px rgba(61, 37, 64, 0.30);
}

/* Night-Modus — wird per [data-mood="night"] auf <html> aktiviert */
[data-mood="night"] {
  --bg:           #1f1023;
  --surface:      #2a1830;
  --surface-alt:  #3a1f3f;
  --ink:          #f6e9d8;
  --ink-soft:     rgba(246, 233, 216, 0.75);
  --ink-mute:     rgba(246, 233, 216, 0.60);
  --ink-faint:    rgba(246, 233, 216, 0.35);
  --ink-hair:     rgba(246, 233, 216, 0.12);
  --shadow-card:  0 1px 0 rgba(255, 255, 255, 0.04),
                  0 8px 24px rgba(0, 0, 0, 0.30);
}

/* ─── Reset (sanft) ─────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }

/* html bekommt denselben bg wie body — sichert die Färbung auch in
   den safe-area-Bereichen (Notch / Dynamic Island), falls theme-color
   vom Browser ignoriert wird. */
html { background: var(--bg); }

/* Body bleibt versteckt, bis auth-guard.js den User verifiziert hat —
   verhindert kurzes Aufblitzen geschützter Inhalte vor dem Redirect. */
html[data-auth="pending"] body { visibility: hidden; }

/* ─── Body + Paper-Hintergrund ─────────────────────────── */
body {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* Papier-Textur als ::before, Vignette als ::after — beide pointer-events: none */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0 3px,
    rgba(61, 37, 64, 0.025) 3px 4px
  );
  opacity: 1;
}
[data-mood="night"] body::before {
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0 3px,
    rgba(255, 240, 230, 0.04) 3px 4px
  );
  opacity: 1;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(
    ellipse at top,
    rgba(220, 163, 74, 0.18),
    transparent 55%
  );
}
[data-mood="night"] body::after {
  background: radial-gradient(
    ellipse at top,
    rgba(220, 163, 74, 0.10),
    transparent 60%
  );
}

/* App-Container damit alles über der Textur liegt.
   padding-bottom = Platz für Tab-Bar (~95-115px) + Sicherheits-Buffer.
   Pages mit eigenem fixed-Composer (Chat) überschreiben das selbst. */
.app {
  position: relative;
  z-index: 1;
  max-width: 480px;            /* mobile-first, zentriert auf Desktop */
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
}

/* ─── Italienische Flagge: Streifen-Detail ──────────────── */
.italian-stripe {
  display: inline-flex;
  border-radius: 1px;
  overflow: hidden;
  vertical-align: middle;
}
.italian-stripe > span { display: block; flex: 1; }
.italian-stripe > span:nth-child(1) { background: var(--basil); }
.italian-stripe > span:nth-child(2) { background: #f5ede0; }
.italian-stripe > span:nth-child(3) { background: var(--terracotta); }

/* ─── Cards ─────────────────────────────────────────────── */
.noni-card {
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
}

/* ─── Buttons ───────────────────────────────────────────── */
.noni-btn {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: -0.1px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  padding: 12px 20px;
  font-size: 15px;
}
.noni-btn:active { transform: scale(0.98); }
.noni-btn:disabled { opacity: 0.4; cursor: default; }

.noni-btn--primary {
  background: var(--accent);
  color: var(--cream);
  box-shadow: var(--shadow-primary);
}
.noni-btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink-hair);
}
.noni-btn--lg { padding: 16px 28px; font-size: 17px; }
.noni-btn--sm { padding: 8px 14px; font-size: 13px; }
.noni-btn--block { width: 100%; }

/* Pill-Round-Buttons (Speaker, Close, etc.) */
.pill-btn {
  width: 36px; height: 36px;
  border-radius: 18px;
  background: var(--ink-hair);
  border: none;
  cursor: pointer;
  color: var(--ink);
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fab-btn {
  width: 56px; height: 56px;
  border-radius: 28px;
  background: var(--accent);
  color: var(--cream);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-fab);
  transition: transform 0.15s ease;
}
.fab-btn:active { transform: scale(0.95); }
.fab-btn--sm { width: 40px; height: 40px; border-radius: 20px; }

/* ─── Chips / Pills ─────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink-hair);
  color: var(--ink-mute);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.chip--accent {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.chip--terracotta { background: color-mix(in srgb, var(--terracotta) 15%, transparent); color: var(--terracotta); }
.chip--saffron    { background: color-mix(in srgb, var(--saffron) 15%, transparent);    color: #8a6020; }
.chip--basil      { background: color-mix(in srgb, var(--basil) 15%, transparent);      color: var(--basil); }

/* StatPill: Zahl + Label nebeneinander, etwas größer als Chip */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink-hair);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-pill > b { font-weight: 700; }
.stat-pill--accent {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}

/* ─── Progress-Bar ──────────────────────────────────────── */
.progress {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--ink-hair);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ─── Header (Top-Bar) ──────────────────────────────────── */
.header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 64px 20px 12px;
}
.streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.streak::before {
  content: "◆";
  color: var(--saffron);
  font-size: 14px;
}

/* ─── Bewertungs-Buttons (Nochmal/Gut/Leicht) ──────────── */
.rate-row {
  display: flex;
  gap: 8px;
}
.rate-btn {
  flex: 1;
  padding: 14px 8px;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-ui);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5),
              0 4px 12px rgba(61, 37, 64, 0.05);
  transition: transform 0.12s ease;
}
.rate-btn:active { transform: scale(0.97); }
.rate-btn--again  { border-color: color-mix(in srgb, var(--terracotta) 35%, transparent); }
.rate-btn--good   { border-color: color-mix(in srgb, var(--saffron) 35%, transparent); }
.rate-btn--easy   { border-color: color-mix(in srgb, var(--basil) 35%, transparent); }

.rate-btn .badge-num {
  width: 22px; height: 22px;
  border-radius: 11px;
  color: var(--cream);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.rate-btn--again .badge-num { background: var(--terracotta); }
.rate-btn--good  .badge-num { background: var(--saffron); }
.rate-btn--easy  .badge-num { background: var(--basil); }

.rate-btn .label {
  font-size: 14px; font-weight: 600; margin-top: 2px;
}

/* ─── Tastatur-Hinweis ──────────────────────────────────── */
.kbd-hint {
  text-align: center;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.3px;
}

/* ─── Topic-Header (Stripe + Topic·Level) ───────────────── */
.topic-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ─── Display-Text: Italienisch in Fraunces italic ──────── */
.it-word {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.it-sentence {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-soft);
}
.ipa {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.3px;
}

/* ─── Image-Slot Placeholder (vor Midjourney-Drop) ──────── */
.char-slot {
  position: relative;
  display: inline-block;
}
.char-slot--circle { border-radius: 50%; overflow: hidden; }
.char-slot--placeholder {
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent) 12%, transparent) 0 6px,
      color-mix(in srgb, var(--accent) 6%, transparent) 6px 12px
    );
  border: 1.5px dashed color-mix(in srgb, var(--accent) 30%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  color: color-mix(in srgb, var(--accent) 70%, transparent);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px;
  line-height: 1.2;
}

/* ─── Helper ─────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-center { text-align: center; }
.hairline { height: 1px; background: var(--ink-hair); }
