/* Fonturile stau in proiect (fonts/), nu vin de la Google: licenta OFL permite vanzarea,
   iar IP-ul vizitatorului nu pleaca nicaieri. Fiecare font e taiat in doua: latin si chirilic,
   iar telefonul descarca doar bucata de care are nevoie (unicode-range). */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(fonts/manrope-lat.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0100-02AF,U+1E00-1EFF,U+2000-206F,U+2020,U+20A0-20CF,U+2113,U+2122,U+2191,U+2193,U+2212,U+2215,U+2C60-2C7F,U+A720-A7FF,U+FEFF,U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(fonts/manrope-cyr.woff2) format('woff2'); unicode-range: U+0301,U+0400-052F,U+1C80-1C8A,U+20B4,U+2116,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/onest-lat.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0100-02AF,U+1E00-1EFF,U+2000-206F,U+2020,U+20A0-20CF,U+2113,U+2122,U+2191,U+2193,U+2212,U+2215,U+2C60-2C7F,U+A720-A7FF,U+FEFF,U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/onest-cyr.woff2) format('woff2'); unicode-range: U+0301,U+0400-052F,U+1C80-1C8A,U+20B4,U+2116,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400 900; font-display: swap; src: url(fonts/golos-lat.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0100-02AF,U+1E00-1EFF,U+2000-206F,U+2020,U+20A0-20CF,U+2113,U+2122,U+2191,U+2193,U+2212,U+2215,U+2C60-2C7F,U+A720-A7FF,U+FEFF,U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-weight: 400 900; font-display: swap; src: url(fonts/golos-cyr.woff2) format('woff2'); unicode-range: U+0301,U+0400-052F,U+1C80-1C8A,U+20B4,U+2116,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/outfit-lat.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0100-02AF,U+1E00-1EFF,U+2000-206F,U+2020,U+20A0-20CF,U+2113,U+2122,U+2191,U+2193,U+2212,U+2215,U+2C60-2C7F,U+A720-A7FF,U+FEFF,U+FFFD; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(fonts/spacegrotesk-lat.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0100-02AF,U+1E00-1EFF,U+2000-206F,U+2020,U+20A0-20CF,U+2113,U+2122,U+2191,U+2193,U+2212,U+2215,U+2C60-2C7F,U+A720-A7FF,U+FEFF,U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url(fonts/jetbrainsmono-lat.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0100-02AF,U+1E00-1EFF,U+2000-206F,U+2020,U+20A0-20CF,U+2113,U+2122,U+2191,U+2193,U+2212,U+2215,U+2C60-2C7F,U+A720-A7FF,U+FEFF,U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url(fonts/jetbrainsmono-cyr.woff2) format('woff2'); unicode-range: U+0301,U+0400-052F,U+1C80-1C8A,U+20B4,U+2116,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }

/* Temele vizuale: Aurora (implicită), Neon Noir, Holo Pastel, Cyber HUD.
   Fiecare temă își definește variabilele pe <html data-theme="…">. */
:root, [data-theme="aurora"] {
  --bg: #0a1024;
  --card: rgba(255,255,255,.09);
  --card-border: rgba(255,255,255,.14);
  --ink: #e9f0ff;
  --muted: #a3b0cc;
  --a1: #2de2a6;
  --a2: #7b5cff;
  --accent: linear-gradient(135deg, var(--a1), var(--a2));
  --accent-ink: #0a1024;
  --on: rgba(45,226,166,.22);
  --ok: rgba(45,226,166,.25);
  --bad: rgba(255,120,150,.22);
  --field: rgba(255,255,255,.06);
  --radius: 20px;
  --font: 'Outfit', 'Manrope', system-ui, sans-serif;
  --blur: blur(14px);
  --clip: none;
}
[data-theme="neon"] {
  --bg: #07060d;
  --card: rgba(255,255,255,.05);
  --card-border: rgba(0,240,255,.28);
  --ink: #f1eaff;
  --muted: #a99fc4;
  --a1: #00f0ff;
  --a2: #ff2bd6;
  --accent-ink: #07060d;
  --on: rgba(255,43,214,.15);
  --ok: rgba(0,240,255,.18);
  --bad: rgba(255,43,214,.2);
  --radius: 14px;
  --font: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
}
[data-theme="holo"] {
  --bg: #f4f1ff;
  --card: rgba(255,255,255,.75);
  --card-border: #ffffff;
  --ink: #1d1b3a;
  --muted: #6e6a90;
  --a1: #7b5cff;
  --a2: #ff5fa2;
  --accent-ink: #ffffff;
  --on: linear-gradient(135deg, #d9ccff, #c3f4ff, #ffd5ea);
  --ok: #d9f9e6;
  --bad: #ffe0ec;
  --field: #ffffff;
  --radius: 18px;
  --font: 'Outfit', 'Manrope', system-ui, sans-serif;
  --blur: none;
}
[data-theme="cyber"] {
  --bg: #050805;
  --card: rgba(198,255,61,.04);
  --card-border: rgba(198,255,61,.5);
  --ink: #c6ff3d;
  --muted: #86a85a;
  --a1: #c6ff3d;
  --a2: #c6ff3d;
  --accent: #c6ff3d;
  --accent-ink: #050805;
  --on: #c6ff3d;
  --ok: rgba(198,255,61,.2);
  --bad: rgba(255,90,90,.2);
  --field: rgba(198,255,61,.05);
  --radius: 0;
  --font: 'JetBrains Mono', ui-monospace, monospace;
  --blur: none;
  --clip: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
/* alegerea fontului din Setari: scrisa dupa teme, ca sa le bata (aceeasi specificitate, ultima castiga).
   „auto” nu apare aici: ramane fontul aspectului, cu Manrope ca rezerva pentru literele lipsa (chirilice). */
[data-font="manrope"] { --font: 'Manrope', 'Manrope', system-ui, sans-serif; }
[data-font="onest"] { --font: 'Onest', 'Manrope', system-ui, sans-serif; }
[data-font="golos"] { --font: 'Golos Text', 'Manrope', system-ui, sans-serif; }
[data-font="outfit"] { --font: 'Outfit', 'Manrope', system-ui, sans-serif; }
[data-font="spacegrotesk"] { --font: 'Space Grotesk', 'Manrope', system-ui, sans-serif; }
[data-font="jetbrainsmono"] { --font: 'JetBrains Mono', 'Manrope', system-ui, sans-serif; }

[data-theme] { --accent: linear-gradient(135deg, var(--a1), var(--a2)); }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.5 var(--font); min-height: 100dvh; isolation: isolate; }
[hidden] { display: none !important; }

/* fundalurile fiecărei teme */
body::before, body::after { content: ""; position: fixed; z-index: -1; pointer-events: none; }
[data-theme="aurora"] body::before, [data-theme="aurora"] body::after { width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(80px); opacity: .55; animation: drift 12s ease-in-out infinite alternate; }
[data-theme="aurora"] body::before { background: var(--a1); top: -30vmax; left: -25vmax; }
[data-theme="aurora"] body::after { background: var(--a2); bottom: -30vmax; right: -30vmax; animation-delay: -6s; }
@keyframes drift { to { transform: translate(8vmax, 10vmax) scale(1.15); } }
[data-theme="neon"] body::before { inset: 0; background: radial-gradient(120% 70% at 50% 0%, #1b1036 0%, transparent 65%); }
[data-theme="holo"] body::before { inset: 0; background: linear-gradient(160deg, #f4f1ff 0%, #e9fbff 50%, #fff2f7 100%); }
[data-theme="cyber"] body::before { inset: 0; background-image: linear-gradient(rgba(198,255,61,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(198,255,61,.06) 1px, transparent 1px); background-size: 22px 22px; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; position: sticky; top: 0; z-index: 5; backdrop-filter: blur(10px); }
.logo { font-weight: 700; font-size: 20px; background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="cyber"] .logo::before { content: "> "; }
.icon-btn { background: none; border: 0; font-size: 22px; cursor: pointer; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-ic { width: 30px; height: 30px; border-radius: 8px; }
.hero-ic { display: block; width: 96px; height: 96px; margin: 8px auto 0; border-radius: 24px; box-shadow: 0 10px 40px rgba(123,92,255,.35); }
.flags { font-size: 22px; letter-spacing: 4px; text-align: center; margin: 4px 0; }
.pair { font-size: 15px; margin: 4px 0; }
.pair a { text-decoration: none; font-weight: 700; padding: 0 6px; }

.screen { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; }
h1 { font-size: 26px; margin: 8px 0 12px; }
h2 { font-size: 13px; margin: 24px 0 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }
[data-theme="cyber"] h2::before { content: "// "; }
h3 { font-size: 16px; margin: 18px 0 8px; }
.lead { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.err { color: #ff6b6b; }
a { color: var(--a1); }

.card, .voice, .theme, .skin { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); backdrop-filter: var(--blur); clip-path: var(--clip); }
[data-theme="holo"] .card, [data-theme="holo"] .voice, [data-theme="holo"] .theme, [data-theme="holo"] .skin { box-shadow: 0 8px 24px rgba(120,100,220,.12); }
.card { padding: 16px; margin: 12px 0; }
label { display: block; font-size: 14px; color: var(--muted); margin: 8px 0; }
input, select { display: block; width: 100%; margin-top: 4px; padding: 12px; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--card-border); border-radius: min(var(--radius), 12px); }
select option { background: var(--bg); color: var(--ink); }
.row { display: flex; gap: 12px; }
.grow { flex: 1; min-width: 0; }

.btn { display: block; width: 100%; margin-top: 12px; padding: 14px; font: inherit; font-weight: 700; color: var(--accent-ink); background: var(--accent); border: 0; border-radius: min(var(--radius), 14px); cursor: pointer; clip-path: var(--clip); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--card-border); }
.btn.danger { background: transparent; color: #ff6b6b; border: 1px solid #ff6b6b; }
.btn.small { width: auto; display: inline-block; padding: 10px 16px; }

.voices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.voice { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; color: var(--ink); cursor: pointer; font: inherit; }
.voice.on { background: var(--on); border-color: var(--a1); }
[data-theme="neon"] .voice.on { border-color: var(--a2); box-shadow: 0 0 16px rgba(255,43,214,.5); }
[data-theme="cyber"] .voice.on { color: var(--accent-ink); }
.voice svg { width: 46px; height: 46px; }
.voice small { color: var(--muted); font-size: 11px; text-align: center; line-height: 1.2; }
[data-theme="cyber"] .voice.on small { color: var(--accent-ink); }

.themes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; text-align: left; color: var(--ink); cursor: pointer; font: inherit; }
.theme:active, .voice:active, .skin:active { transform: scale(.98); }
.theme .ic { font-size: 24px; }
.theme small { color: var(--muted); font-size: 13px; }
.prog { display: block; width: 100%; height: 5px; margin-top: 8px; background: rgba(128,128,128,.22); border-radius: 3px; overflow: hidden; }
.prog span { display: block; height: 100%; background: var(--accent); }
[data-theme="neon"] .prog span { box-shadow: 0 0 8px var(--a1); }
.prog.big { height: 10px; border-radius: 5px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; background: var(--bad); border-radius: 999px; font-size: 14px; }
.chip.ok { background: var(--ok); }
[data-theme="cyber"] .chip { border-radius: 0; }
.weak { padding-left: 18px; }
.weak li { margin: 6px 0; }

/* alegerea aspectului (Setări) */
.skins { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.skin { padding: 10px; color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.skin.on { border-color: var(--a1); outline: 2px solid var(--a1); }
.skin .sw { display: block; height: 54px; margin-bottom: 8px; border-radius: 10px; }
.sw-aurora { background: radial-gradient(circle at 20% 30%, #2de2a6, transparent 60%), radial-gradient(circle at 80% 80%, #7b5cff, transparent 60%), #0a1024; }
.sw-neon { background: linear-gradient(135deg, transparent 40%, #00f0ff 41%, #00f0ff 44%, transparent 45%, transparent 55%, #ff2bd6 56%, #ff2bd6 59%, transparent 60%), #07060d; }
.sw-holo { background: linear-gradient(135deg, #c8b6ff, #a8f0ff, #b9ffd9, #ffc6e5); }
.sw-cyber { background: linear-gradient(rgba(198,255,61,.25) 1px, transparent 1px) 0 0 / 10px 10px, linear-gradient(90deg, rgba(198,255,61,.25) 1px, transparent 1px) 0 0 / 10px 10px, #050805; border-radius: 0 !important; }

/* alegerea fontului (Setări): cardul foloseste stilul .skin */
.fonts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.fnt .aa { display: block; font-size: 26px; line-height: 1.2; margin-bottom: 6px; }

/* moduri de lucru (Setări) */
.engines { display: flex; flex-direction: column; gap: 8px; }
.engine { display: flex; gap: 12px; align-items: flex-start; padding: 12px; text-align: left; color: var(--ink); font: inherit; cursor: pointer; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); clip-path: var(--clip); }
.engine.on { border-color: var(--a1); outline: 2px solid var(--a1); }
.engine .ic { font-size: 24px; }
.theme.dim { opacity: .5; }
.free-ctrl { display: flex; gap: 8px; width: 100%; }
.free-ctrl .btn { flex: 1; margin-top: 8px; }

/* ---------- lecția ---------- */
.lesson { display: flex; flex-direction: column; align-items: center; min-height: calc(100dvh - 60px); }
.lesson h1 { margin: 0; font-size: 30px; }
.stage { --lvl: 0; position: relative; display: grid; place-items: center; width: 260px; height: 240px; margin: 12px auto 4px; }
.stage .avatar { width: 180px; height: 180px; transform: scale(calc(1 + var(--lvl) * .12)); transition: transform .08s linear; animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { translate: 0 -8px; } }
.ring { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 160px; height: 160px; border-radius: 50%; border: 2px solid var(--a1); opacity: 0; }
[data-theme="cyber"] .ring { border-radius: 0; border-style: dashed; }
.stage[data-mode="teacher"] .ring { animation: ring 2.4s ease-out infinite; }
.stage[data-mode="teacher"] .ring.r2 { animation-delay: 1.2s; }
@keyframes ring { from { width: 160px; height: 160px; opacity: .8; } to { width: 270px; height: 270px; opacity: 0; } }
.stage[data-mode="listen"] .ring { opacity: calc(.2 + var(--lvl)); width: calc(170px + var(--lvl) * 90px); height: calc(170px + var(--lvl) * 90px); border-color: var(--a2); }
.stage[data-mode="wait"] .avatar { opacity: .55; }

.eye { animation: blink 4s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.mouth { transform-box: fill-box; transform-origin: center; transform: scaleY(.35); }
.stage[data-mode="teacher"] .mouth { animation: talk .3s ease-in-out infinite alternate; }
@keyframes talk { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
.spin { animation: spin 14s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }

.status { font-size: 19px; font-weight: 600; min-height: 30px; margin: 4px 0; color: var(--a1); }
[data-theme="holo"] .status { color: var(--a1); }
.wave { display: flex; gap: 3px; justify-content: center; align-items: center; height: 30px; margin-bottom: 6px; }
.wave i { width: 4px; height: 6px; border-radius: 2px; background: var(--accent); }
[data-theme="cyber"] .wave i { border-radius: 0; }
.stage[data-mode="teacher"] ~ .wave i { animation: w 1s ease-in-out infinite; }
.stage ~ .wave i:nth-child(2n) { animation-delay: -.3s; } .stage ~ .wave i:nth-child(3n) { animation-delay: -.6s; } .stage ~ .wave i:nth-child(5n) { animation-delay: -.15s; }
@keyframes w { 0%, 100% { height: 6px; } 50% { height: 28px; } }
.subs { width: 100%; max-height: 30dvh; overflow-y: auto; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 8px 12px; backdrop-filter: var(--blur); }
.subs p { margin: 6px 0; }
.subs .teacher { color: var(--a1); }
.subs .user::before { content: "Tu: "; color: var(--muted); }
.opts { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; width: 100%; }
.switch { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.switch input { width: auto; margin: 0; accent-color: var(--a1); }
.end { margin-top: auto; background: #e5484d; color: #fff; }

.toast { position: fixed; left: 16px; right: 16px; bottom: 20px; max-width: 600px; margin: 0 auto; padding: 12px 16px; background: var(--ink); color: var(--bg); border-radius: 12px; z-index: 20; }

@media (max-width: 380px) {
  .voices { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
