/* =============================================================
   pogadaj.se — Style aplikacji (komponenty + ekrany)
   ============================================================= */

.app-root {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 40px) 80px;
  min-height: 100vh;
  position: relative;
  z-index: 1;            /* treść nad tłem .cosmos */
}

/* ---------- Komponenty bazowe ---------- */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text);
  background: var(--bg-600);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: linear-gradient(135deg, #4f86c6, #74aee4); box-shadow: var(--glow-accent); color: #06223f; border: 2px solid #ffffff; }
.btn--ghost { background: transparent; border-color: var(--surface-border); }
.btn--pink { background: linear-gradient(135deg, var(--pink), var(--violet)); box-shadow: var(--glow-pink); }
.btn--lg { padding: 16px 32px; font-size: 1.1rem; }
.btn--block { width: 100%; justify-content: center; }

/* Na pokładzie (poza logowaniem) przyciski główne są błękitne, nie pomarańczowe */
body:not([data-route="welcome"]) .btn--primary {
  background: linear-gradient(135deg, #4f86c6, #74aee4); color: #06223f;
}

/* Przycisk „Izabeli" — błękit jak jej golf, pogrubiony biały napis */
.btn--iza {
  background: linear-gradient(135deg, #4f86c6, #74aee4);
  color: #fff; font-weight: 800; letter-spacing: .01em;
  box-shadow: 0 10px 30px rgba(79, 134, 198, .5);
  text-shadow: 0 1px 2px rgba(0, 40, 80, .4);
}
.btn--iza:hover { box-shadow: 0 14px 36px rgba(79, 134, 198, .6); }

.card {
  background: var(--surface-glass);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 32px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-700);
  border: 1px solid var(--surface-border);
  font-size: .85rem; color: var(--text-dim);
}

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; gap: var(--gap); align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- Pasek górny / logo ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.logo { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; letter-spacing: -0.03em;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo .dot { color: var(--accent); }
.logo .se { color: inherit; }

/* ---------- Widok lekcji: duża scena + panel dialogu ---------- */
/* W lekcji: JASNY motyw w kolorach robota ze sceny (biel + błękity) */
body.in-lesson .cosmos { display: none; }
body.in-lesson {
  --text: #14314f; --text-dim: #46688c; --text-faint: #7b96b3;
  --surface-border: rgba(100, 170, 225, .35);
  background: linear-gradient(180deg, #e6f2fd 0%, #f7fbff 55%, #e9f5fe 100%);
}
body.in-lesson .logo { text-shadow: none; }
body.in-lesson .card {
  background: rgba(255,255,255,.88); border-color: #cfe6f8;
  box-shadow: 0 14px 36px rgba(70,130,190,.16);
}
body.in-lesson .pill { background: #eaf5ff; border-color: #bfe0f7; color: #46688c; }
body.in-lesson .suggest-chip { background: #eaf6ff; border-color: #a8d8f2; color: #14526f; }
body.in-lesson .suggest-chip:hover { border-color: #1d9fd8; }
body.in-lesson .mic-btn {
  background: linear-gradient(135deg, #4f86c6, #74aee4);
  color: #fff; border: none;
  box-shadow: 0 0 26px rgba(80,160,230,.5);
}
body.in-lesson .mic-btn.recording {
  background: linear-gradient(135deg, #e66a84, #ff9fb2); color: #fff;
}
body.in-lesson .btn--ghost { border-color: #b5d9f0; color: #2c5a80; background: rgba(255,255,255,.6); }

.lesson-view {
  --accent: #2596d1; --accent-bright: #1d9fd8; --violet: #5b78ff;
  --glow-accent: 0 0 24px rgba(60,170,230,.4);
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: stretch;
  max-width: 1120px; margin: 0 auto;
}
@media (max-width: 860px) { .lesson-view { grid-template-columns: 1fr; } }

.lesson-stage {
  position: relative; border-radius: 20px; overflow: hidden; cursor: pointer;
  background: #0e1422; border: 1px solid rgba(120,150,200,.18); min-height: 340px;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
.lesson-stage img { width: 100%; height: 100%; min-height: 340px; object-fit: cover; display: block; }
.lesson-stage.speaking { box-shadow: 0 0 0 2px var(--accent), 0 16px 48px rgba(0,0,0,.5); }
.stage-name {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: rgba(10,14,24,.7); color: #cfe0ff; padding: 6px 12px; border-radius: 999px;
  font-family: var(--font-display); font-size: .85rem; backdrop-filter: blur(6px);
}
/* Dymek Izabeli — wychodzi od niej (ogonek do góry), biel + błękit jak robot */
.stage-caption {
  position: absolute; left: 50%; bottom: 16px; z-index: 2;
  transform: translateX(-50%) translateY(10px);
  max-width: 84%; min-width: 40%;
  padding: 14px 20px;
  background: rgba(255,255,255,.96); color: #14314f;
  border: 2px solid #a5ddf3; border-radius: 20px;
  box-shadow: 0 12px 34px rgba(20,70,120,.3);
  font-size: 1.02rem; line-height: 1.45; text-align: center;
  opacity: 0; transition: opacity .3s ease, transform .3s ease;
}
.stage-caption::before {
  content: ''; position: absolute; top: -12px; left: 50%;
  width: 20px; height: 20px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(255,255,255,.96);
  border-left: 2px solid #a5ddf3; border-top: 2px solid #a5ddf3;
}
.stage-caption.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.lesson-panel {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  background: rgba(255,255,255,.9); border: 1px solid #cfe6f8;
  border-radius: 20px; padding: 18px; backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(70,130,190,.16);
}
/* „Pomiń" dyskretnie w rogu panelu — nie miesza się z głównymi przyciskami */
.skip-corner {
  position: absolute; top: 10px; right: 12px; z-index: 4;
  padding: 4px 10px; font-size: .78rem; opacity: .5;
}
.skip-corner:hover { opacity: 1; }
.lesson-panel .chat { max-height: 34vh; }
/* panel jest tylko dla ucznia — jego wypowiedzi na jasnym błękicie */
.lesson-panel .msg--user {
  background: linear-gradient(135deg, #ddefff, #c2e4ff);
  color: #123a5e; border: 1px solid #a8d4f5;
}

/* ---------- Karta czatu: Izabela + rozmowa jako JEDEN element ---------- */
.lesson-chat-card {
  --accent: #2596d1; --accent-bright: #1d9fd8;
  --glow-accent: 0 0 24px rgba(60, 170, 230, .4);
  display: grid; grid-template-columns: minmax(230px, .8fr) 1.2fr;
  max-width: 1120px; margin: 0 auto;
  background: #fff; border: 1px solid #cfe6f8;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 16px 44px rgba(70, 130, 190, .2);
}
.lc-stage { position: relative; min-height: 500px; cursor: pointer; overflow: hidden; }
.lc-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.09); }
.lc-stage.speaking::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 3px #5fc6ee, inset 0 0 46px rgba(95, 198, 238, .35);
}
.lc-main {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 16px 18px; min-height: 500px;
}
.lc-main .chat { flex: 1; max-height: 52vh; padding-left: 16px; }

/* Dymek Izabeli w czacie — ogonek celuje w nią (w lewo, w stronę zdjęcia) */
body.in-lesson .msg--izabela {
  position: relative; align-self: flex-start;
  background: #eef7ff; border: 2px solid #a5ddf3; color: #14314f;
  border-radius: 14px; border-top-left-radius: 4px;
}
body.in-lesson .msg--izabela::before {
  content: ''; position: absolute; left: -11px; top: 12px;
  width: 16px; height: 16px; transform: rotate(45deg);
  background: #eef7ff;
  border-left: 2px solid #a5ddf3; border-bottom: 2px solid #a5ddf3;
}
body.in-lesson .msg--user {
  background: linear-gradient(135deg, #ddefff, #c2e4ff);
  color: #123a5e; border: 1px solid #a8d4f5;
}

/* „Powtórz: ..." — aktualna fraza do powiedzenia; klik = Izabela czyta ją znowu.
   Wyrównane w pionie z przyciskiem mikrofonu (ta sama szerokość, wyśrodkowane). */
.say-target { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 34px; width: 100%; }
.say-target__label { color: var(--text-dim); font-size: .85rem; }
.say-target__phrase {
  width: min(340px, 90%); text-align: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  color: #16305a; cursor: pointer;
  background: radial-gradient(ellipse at center, #ffffff 20%, #e3eef9 62%, #bcd4e8 100%);
  border: 2px solid #16305a; border-radius: 10px; padding: 10px 16px;
  transition: transform .12s ease, box-shadow .15s ease;
}
.say-target__phrase:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(6,25,55,.35); }

@media (max-width: 860px) {
  .lesson-chat-card { grid-template-columns: 1fr; }
  /* na tablecie zdjęcie Izabeli DUŻE (rozszerzone), na telefonie niżej zmniejszamy */
  .lc-stage { min-height: 42vh; }
  .lc-main { min-height: auto; }
  .lc-main .chat { max-height: 38vh; }
}

/* ---------- Ilustrowana Izabela (portret w lekcji) ---------- */
.iza-portrait { width: clamp(120px, 28vw, 180px); border-radius: 16px; overflow: hidden; flex: none;
  border: 2px solid var(--surface-border); box-shadow: var(--shadow-card); transition: box-shadow .2s, border-color .2s; }
.iza-portrait img { width: 100%; display: block; }
.iza-portrait.speaking { border-color: var(--accent); box-shadow: var(--glow-accent); animation: portraitPulse 1.3s ease-in-out infinite; }
@keyframes portraitPulse { 0%,100% { box-shadow: var(--glow-accent); } 50% { box-shadow: 0 0 34px rgba(255,122,24,.6); } }
.iza-portrait--sm { width: clamp(96px, 22vw, 130px); }

/* ---------- Awatar Izabeli (komponent) ---------- */
.iza-av { position: relative; border-radius: 50%; overflow: visible; flex: none; }
.iza-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 22%;
  border: 2px solid var(--ring, var(--accent)); box-shadow: 0 0 16px color-mix(in srgb, var(--ring, var(--accent)) 45%, transparent); }
.iza-av.speaking::after { content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid var(--ring, var(--accent)); animation: pulse 1.2s ease-out infinite; }

/* ---------- Izabela (awatar — legacy) ---------- */
.izabela {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #2a2230, #16161f);
  border: 2px solid var(--surface-border);
  display: grid; place-items: center;
  position: relative;
  box-shadow: var(--glow-accent);
}
.izabela img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.izabela--speaking::after {
  content: ''; position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--pink);
  animation: pulse 1.2s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.25); opacity: 0; } }

/* ---------- Wspólna karta „Izabela + treść" (onboarding, test fonetyczny) ----------
   JEDEN sklejony element: zdjęcie Izabeli z dymkiem po lewej, treść po prawej —
   dokładnie jak karta czatu w lekcji. Jasny motyw. */
.iza-card {
  display: grid; grid-template-columns: minmax(240px, .8fr) 1.2fr;
  max-width: 1080px; margin: 0 auto;
  background: #fff; border: 1px solid #cfe6f8; border-radius: 20px; overflow: hidden;
  box-shadow: 0 16px 44px rgba(70, 130, 190, .2);
  color: #14314f;
}
.iza-card__stage { position: relative; min-height: 560px; overflow: hidden; }
/* scale(1.09) przycina brzegi grafiki — znaczek AI z rogu znika */
.iza-card__stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block; transform: scale(1.09); }
.iza-card__bubble {
  position: absolute; left: 6%; right: 6%; bottom: 5%;
  background: rgba(255,255,255,.96); color: #14314f;
  border: 2px solid #a5ddf3; border-radius: 14px;
  padding: 10px 14px; font-size: .92rem; line-height: 1.4; text-align: center;
  box-shadow: 0 10px 28px rgba(20,70,120,.3);
  /* dymek zmienia się automatycznie (jedno zdanie), więc bez ręcznego scrolla */
  max-height: 44%; overflow: hidden;
}
.iza-card__bubble::before {
  content: ''; position: absolute; top: -11px; left: 50%;
  width: 18px; height: 18px; transform: translateX(-50%) rotate(45deg);
  background: rgba(255,255,255,.96);
  border-left: 2px solid #a5ddf3; border-top: 2px solid #a5ddf3;
}
.iza-card__main { padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; min-height: 560px; }
/* Telefon i tablet (także w pionie): karta układa się w pionie — obraz na
   górze, treść pod spodem. Dzięki temu nic się nie ściska ani nie nachodzi. */
@media (max-width: 960px), (orientation: portrait) {
  .iza-card { grid-template-columns: 1fr; }
  .iza-card__stage { min-height: 300px; }
  .iza-card__main { min-height: auto; }
}
@media (max-width: 520px) {
  .iza-card__stage { min-height: 240px; }
  .iza-card__bubble { font-size: .86rem; padding: 8px 11px; }
}

/* jasna treść wewnątrz karty (wybory, pasek, pola, wyniki testu) */
.iza-card h2 { color: #14314f; }
.iza-card .muted { color: #46688c; }
.iza-card .faint { color: #7b96b3; }
.iza-card .progress { background: #e3eef9; }
.iza-card .progress > i { background: linear-gradient(90deg, #4f86c6, #84c4ff); }
.iza-card .choice {
  background: radial-gradient(ellipse at center, #ffffff 25%, #e3eef9 65%, #c4d8ea 100%);
  border: 2px solid #16305a; border-radius: 10px; color: #14314f;
}
.iza-card .choice:hover { border-color: #1d9fd8; }
.iza-card .choice.selected {
  border-color: #1d9fd8; background: radial-gradient(ellipse at center, #ffffff 30%, #d9edfb 70%, #b9dcf2 100%);
  box-shadow: 0 0 0 2px #1d9fd8, 0 10px 26px rgba(6,25,55,.3);
}
.iza-card .choice .title { color: #16305a; }
.iza-card .choice .desc { color: #46688c; }
.iza-card .btn--ghost { border-color: #b5d9f0; color: #2c5a80; background: rgba(255,255,255,.7); }
.iza-card .field input { background: #f2f8fd; color: #14314f; border: 1px solid #cfe6f8; }
.iza-card .field input:focus { border-color: #1d9fd8; }
.iza-card .field input::placeholder { color: #8aa5bf; }
.iza-card .phonetic-word { color: #16305a; }
.iza-card .phonetic-ipa { color: #1d9fd8; }
.iza-card .phonetic-pl, .iza-card .phonetic-hint { color: #46688c; }
.iza-card .word-dots i { background: #d7e6f2; }
.iza-card .word-dots i.done { background: #17b8ae; }
.iza-card .word-dots i.active { background: #1d9fd8; box-shadow: 0 0 10px rgba(29,159,216,.6); }
.iza-card .spinner { border-color: #e3eef9; border-top-color: #1d9fd8; }
.iza-card .pron-result { border-top: 1px solid #cfe6f8; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.choice {
  text-align: left; padding: 18px; border-radius: var(--radius);
  background: var(--bg-700); border: 1.5px solid var(--surface-border);
  cursor: pointer; transition: border-color .15s, transform .12s, background .15s;
}
.choice:hover { transform: translateY(-2px); border-color: var(--accent); }
.choice.selected { border-color: var(--accent); background: var(--bg-600); box-shadow: var(--glow-accent); }
.choice .emoji { font-size: 1.6rem; }
.choice .title { font-family: var(--font-display); font-weight: 600; margin: 6px 0 4px; }
.choice .desc { font-size: .85rem; color: var(--text-dim); }

.progress { height: 6px; background: var(--bg-700); border-radius: var(--radius-pill); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--violet)); transition: width .3s ease; }

/* ---------- Paszport Fonetyczny ---------- */
/* Układ: Izabela (patrzy na ucznia) po lewej, test po prawej */
.phonetic-layout {
  display: grid; grid-template-columns: minmax(230px, .75fr) 1.25fr;
  gap: 22px; align-items: start; max-width: 1050px; margin: 0 auto;
}
.phonetic-iza { position: relative; border-radius: 18px; overflow: hidden;
  border: 2px solid #16305a; box-shadow: var(--shadow-card); }
.phonetic-iza img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 20%; display: block; }
.phonetic-iza__bubble {
  position: absolute; left: 6%; right: 6%; bottom: 5%;
  background: rgba(255,255,255,.96); color: #14314f;
  border: 2px solid #a5ddf3; border-radius: 14px;
  padding: 10px 14px; font-size: .9rem; line-height: 1.4; text-align: center;
  box-shadow: 0 10px 28px rgba(20,70,120,.3);
}
.phonetic-iza__bubble::before {
  content: ''; position: absolute; top: -11px; left: 50%;
  width: 18px; height: 18px; transform: translateX(-50%) rotate(45deg);
  background: rgba(255,255,255,.96);
  border-left: 2px solid #a5ddf3; border-top: 2px solid #a5ddf3;
}
@media (max-width: 760px) {
  .phonetic-layout { grid-template-columns: 1fr; }
  .phonetic-iza img { aspect-ratio: 16 / 9; object-position: 50% 12%; }
}

.phonetic-word { font-family: var(--font-display); font-size: clamp(2.5rem, 8vw, 4.5rem); font-weight: 700; }
.phonetic-ipa { color: var(--accent-bright); font-size: 1.4rem; letter-spacing: .05em; }
.phonetic-pl { color: var(--text-dim); font-size: 1.15rem; margin-top: -6px; }
.phonetic-hint { color: var(--text-dim); font-size: .95rem; }
.phon-count { font-weight: 700; color: #16305a; font-size: .95rem; }

/* Przyciski "kwadratowe": jaśniejszy środek, ciemniejsza (granatowa) ramka */
.btn--sq {
  border-radius: 10px;
  background: radial-gradient(ellipse at center, #ffffff 20%, #e3eef9 62%, #bcd4e8 100%);
  color: #16305a; border: 2px solid #16305a;
  font-weight: 600; justify-content: center;
}
.btn--sq:hover { box-shadow: 0 8px 20px rgba(6,25,55,.4), 0 0 14px rgba(120,190,255,.35); }

/* Mikrofon — rozciągnięty przycisk (nie kółko), biały napis */
.mic-btn {
  width: min(340px, 90%); height: 60px; border-radius: 10px;
  border: none; cursor: pointer;
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff; box-shadow: var(--glow-accent);
  transition: transform .1s; display: grid; place-items: center;
  text-align: center; line-height: 1.1; padding: 4px 18px;
  margin: 0 auto;
}
.mic-btn:active { transform: scale(.94); }
/* Mikrofon spójny z błękitem pokładu (golf Izabeli) */
body:not([data-route="welcome"]) .mic-btn {
  background: linear-gradient(135deg, #4f86c6, #82c4ff);
  box-shadow: 0 0 26px rgba(91, 159, 224, .5);
}
.mic-btn.recording { background: linear-gradient(135deg, var(--error), var(--pink)); animation: rec 1s infinite; }
@keyframes rec { 0%,100% { box-shadow: 0 0 0 0 rgba(255,107,129,.5); } 50% { box-shadow: 0 0 0 18px rgba(255,107,129,0); } }
.spinner { width: 38px; height: 38px; border-radius: 50%; margin: 0 auto;
  border: 4px solid var(--bg-600); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.score-bar { height: 12px; border-radius: 999px; background: var(--bg-700); overflow: hidden; }
.score-bar > i { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }
.pron-result { border-top: 1px solid var(--surface-border); padding-top: 14px; }
.pron-issue { margin-top: 8px; display: inline-block; padding: 4px 12px; border-radius: 8px;
  background: #fff0f2; color: #b3231f; border: 2px solid #d23c37; font-size: .85rem; font-weight: 600; }

/* Finał paszportu: Izabela + dymek od jej ust (biel + błękit) */
.passport-scene {
  display: flex; align-items: center; justify-content: center;
  max-width: 920px; margin: 4vh auto 0; flex-wrap: wrap;
}
.passport-iza-wrap { overflow: hidden; border-radius: 18px; }
.passport-iza {
  width: clamp(240px, 34vw, 360px); aspect-ratio: 3 / 4;
  object-fit: cover; object-position: 40% 18%;   /* kadr na Izabelę ze statku */
  transform: scale(1.09);                          /* przycina znaczek AI z rogu */
  border-radius: 18px; border: 2px solid #16305a;
  box-shadow: var(--shadow-card); display: block;
}
.passport-bubble {
  position: relative; flex: 1; min-width: 280px; max-width: 470px;
  margin-left: 28px;
  background: #fff; color: #14314f;
  border: 2px solid #a5ddf3; border-radius: 22px;
  padding: 22px 24px;
  box-shadow: 0 16px 44px rgba(20,70,120,.3);
}
/* ogonek dymka — celuje w usta Izabeli (lewa strona, ~1/3 wysokości) */
.passport-bubble::before {
  content: ''; position: absolute; left: -13px; top: 34%;
  width: 22px; height: 22px; transform: rotate(45deg);
  background: #fff; border-left: 2px solid #a5ddf3; border-bottom: 2px solid #a5ddf3;
}
.passport-bubble__title { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; margin-bottom: 10px; }
.passport-bubble__label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: #1d9fd8; margin-bottom: 6px; }
.passport-bubble .faint { color: #7b96b3; }
.passport-bubble .score-bar { background: #e3f1fb; }
.passport-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.passport-chip {
  background: #e9f7ff; border: 1px solid #a5ddf3; color: #14526f;
  border-radius: 999px; padding: 5px 12px; font-size: .85rem;
}
@media (max-width: 680px) {
  .passport-bubble { margin: 20px 0 0; }
  .passport-bubble::before {
    left: 46%; top: -13px; border: none;
    border-left: 2px solid #a5ddf3; border-top: 2px solid #a5ddf3;
  }
}

.word-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.word-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--bg-600); }
.word-dots i.done { background: var(--cyan); }
.word-dots i.active { background: var(--accent); box-shadow: var(--glow-accent); }

/* ---------- Rozmowa + Analityk ---------- */
.convo-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .convo-layout { grid-template-columns: 1fr; } }

.chat { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; padding-right: 8px; }
.msg { max-width: 82%; padding: 12px 16px; border-radius: var(--radius); line-height: 1.45; }
.msg--izabela { align-self: flex-start; background: var(--bg-700); border: 1px solid var(--surface-border); border-bottom-left-radius: 4px; }
.msg--user { align-self: flex-end; background: linear-gradient(135deg, var(--accent-soft), var(--accent)); border-bottom-right-radius: 4px; }
.msg .who { font-size: .72rem; opacity: .7; margin-bottom: 4px; font-family: var(--font-display); }
.msg .correction { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(255,255,255,.18); font-size: .9rem; }
.msg .correction b { color: var(--warn); }

.analyst { position: sticky; top: 24px; }
.analyst h3 { margin: 0 0 4px; font-size: 1.05rem; }
.analyst .empty { color: var(--text-faint); font-size: .9rem; padding: 12px 0; }
.mistake { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-700); border: 1px solid var(--surface-border); margin-bottom: 8px; }
.mistake .bad { color: var(--error); text-decoration: line-through; }
.mistake .good { color: var(--cyan); }
.mistake .note { font-size: .82rem; color: var(--text-dim); margin-top: 4px; }
.mistake .tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }

/* Zadanie mówione */
.task-en { font-family: var(--font-display); font-size: 1.35rem; margin-bottom: 10px; line-height: 1.4; }
.task-pl { color: var(--text-dim); font-size: 1.05rem; margin-bottom: 16px; }
.task-underline {
  font: inherit; color: var(--accent-bright); cursor: pointer;
  background: none; border: none; padding: 0 2px;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.task-underline::after { content: ''; font-size: .75em; opacity: .8; }
.task-underline:hover { color: var(--accent); }
.task-opts { display: flex; flex-wrap: wrap; gap: 10px; }

/* Podpowiedzi słów (chipsy) */
.suggest-row { margin-top: 14px; }
.suggest-hint { font-size: .8rem; color: var(--text-faint); text-align: center; margin-bottom: 8px; }
.suggest-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.suggest-chip {
  font-family: var(--font-body); font-size: .9rem; cursor: pointer;
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: var(--bg-700); color: var(--accent-bright);
  border: 1px solid var(--surface-border); transition: transform .1s, border-color .15s;
}
.suggest-chip::before { content: ''; font-size: .8em; }
.suggest-chip:hover { transform: translateY(-1px); border-color: var(--accent); }

/* Przełącznik języka mówienia ucznia (PL/EN) */
.lang-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; }
.lang-opt {
  font-family: var(--font-display); font-size: .85rem; cursor: pointer;
  padding: 5px 14px; border-radius: var(--radius-pill);
  background: var(--bg-700); border: 1px solid var(--surface-border); color: var(--text-dim);
  transition: background .15s, color .15s, border-color .15s;
}
.lang-opt.active { background: linear-gradient(135deg, #4f86c6, #74aee4); color: #fff; border-color: transparent; font-weight: 700; }

.composer { display: flex; gap: 10px; margin-top: 14px; align-items: center; }
.composer input {
  flex: 1; padding: 14px 18px; border-radius: var(--radius-pill);
  background: var(--bg-700); border: 1px solid var(--surface-border);
  color: var(--text); font-size: 1rem; font-family: var(--font-body);
}
.composer input:focus { outline: none; border-color: var(--accent); }
.mic-mini { width: 52px; height: 52px; border-radius: 50%; flex: none; font-size: 1.3rem; }

/* ---------- Lekcje ---------- */
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.lesson-card { position: relative; overflow: hidden; }
.lesson-card .num { font-family: var(--font-display); font-size: 3rem; opacity: .15; position: absolute; top: 8px; right: 18px; }
.lesson-card.locked { opacity: .55; }
.lesson-card .status { font-size: .8rem; }
.badge { font-size: .72rem; padding: 3px 10px; border-radius: var(--radius-pill); }
.badge--free { background: rgba(70,224,216,.15); color: var(--cyan); }
.badge--done { background: rgba(255,122,24,.18); color: var(--accent-bright); }
.badge--locked { background: rgba(255,255,255,.08); color: var(--text-faint); }

/* ---------- Toasty ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #ffffff; color: #14314f;
  border: 2px solid #16305a; border-left-width: 8px; border-left-color: #1d9fd8;
  padding: 12px 18px; border-radius: 10px;
  font-weight: 600; font-size: .95rem;
  max-width: min(92vw, 560px);
  box-shadow: 0 12px 30px rgba(6, 25, 55, .35);
  animation: toastIn .25s ease;
}
.toast--error {
  border-color: #8f1d1d; border-left-color: #d23c37;
  background: #fff5f5; color: #7a1330;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; } }

/* ---------- Ekran logowania / powitania ---------- */
.auth-wrap { max-width: 460px; margin: 4vh auto 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.auth-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 4.4rem); letter-spacing: -0.02em; line-height: 1;
  text-transform: uppercase; margin: 0;
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
  display: flex; align-items: center; gap: .12em;
}
/* Kropka jak w domenie pogadaj.se — siedzi na linii tekstu, nie w połowie */
.auth-title .planet-dot {
  width: .22em; height: .22em; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8efff, #4f86c6 60%, #23405f);
  box-shadow: 0 0 14px rgba(130,196,255,.75); display: inline-block;
  align-self: flex-end; margin-bottom: .1em;
}
.auth-sub {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: #fff; font-size: clamp(.95rem, 3.5vw, 1.25rem);
  margin: 4px 0 26px;
}
.auth-card { width: 100%; background: rgba(18,18,26,.85); border: 1px solid rgba(255,255,255,.06);
  border-radius: 22px; padding: 28px 24px; box-shadow: var(--shadow-card); backdrop-filter: blur(8px); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 8px; font-weight: 600; }
.field input { width: 100%; padding: 15px 18px; border-radius: 12px; background: #1c1c26;
  border: 1px solid rgba(255,255,255,.07); color: var(--text); font-size: 1rem; font-family: var(--font-body); }
.field input::placeholder { color: #5a5a6a; }
.field input:focus { outline: none; border-color: var(--accent); }
.auth-submit { width: 100%; justify-content: center; text-transform: uppercase; letter-spacing: .04em;
  font-size: 1.05rem; padding: 16px; margin-top: 4px; border-radius: 12px; font-weight: 700; }
.auth-submit .arrow { display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 6px; background: rgba(0,0,0,.18); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px;
  color: var(--text-faint); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.08); }
.auth-oauth { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.oauth-btn { justify-content: center; background: #1c1c26; border: 1px solid rgba(255,255,255,.08);
  text-transform: uppercase; letter-spacing: .05em; font-size: .85rem; font-weight: 600; padding: 14px; border-radius: 12px; }
.oauth-btn:hover { border-color: rgba(255,255,255,.2); }
.auth-create { width: 100%; justify-content: center; background: #1c1c26; border: 1px solid rgba(255,255,255,.08);
  color: var(--accent-bright); text-transform: uppercase; letter-spacing: .05em; font-size: .9rem;
  font-weight: 700; padding: 16px; margin-top: 14px; border-radius: 12px; }
.auth-create:hover { border-color: var(--accent); }
.auth-footer { margin-top: 22px; color: var(--text-faint); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; }
.auth-footer b { color: var(--accent-bright); font-weight: 700; }
/* dyskretny reset postępów (przydatny do testów „świeżego" użytkownika) */
.auth-reset {
  margin-top: 10px; background: none; border: none; cursor: pointer;
  color: var(--text-faint); font-size: .72rem; opacity: .6;
  text-decoration: underline; text-underline-offset: 3px;
}
.auth-reset:hover { opacity: 1; color: var(--text-dim); }

/* Pływający badge Izabeli (lewy dolny róg — jak w projekcie) */
.iza-badge { position: fixed; left: 18px; bottom: 18px; width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid var(--pink); overflow: hidden; box-shadow: 0 0 16px rgba(255,126,182,.4); z-index: 50; background: var(--bg-700); }
.iza-badge img { width: 100%; height: 100%; object-fit: cover; }
.iza-badge .dot { position: absolute; top: 2px; right: 2px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--cyan); border: 2px solid var(--bg-900); }

/* ---------- Intro: odtwarzacz wideo Izabeli ---------- */
.intro-video-wrap { max-width: 760px; margin: 4vh auto 0; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.intro-video {
  width: 100%; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--surface-border); box-shadow: var(--shadow-card); background: #000;
}
.intro-video video { width: 100%; display: block; }
.intro-skip { position: absolute; top: 16px; right: 16px; z-index: 5; }

/* ---------- Intro: pełnoekranowy filmik powitalny ---------- */
.intro-full { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; align-items: center; justify-content: center; }
.intro-full video { width: 100%; height: 100%; object-fit: cover; background: #000; transform: scale(1.06); }
.intro-full .intro-skip { position: fixed; top: max(16px, env(safe-area-inset-top)); right: 16px; }
.intro-play { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 62; }
.intro-play.hidden { display: none !important; }

/* ---------- Hero: pełnoekranowa Izabela (kadr 16:9) ---------- */
.hero { position: fixed; inset: 0; z-index: 40; background: #06090f; display: grid; place-items: center; overflow: hidden; }
/* Największy kadr 16:9 mieszczący się w ekranie — obraz nie jest kadrowany,
   dzięki czemu przycisk i dymek trzymają się dłoni Izabeli na każdym ekranie. */
.hero__frame { position: relative; width: min(100vw, 177.78vh); height: min(100vh, 56.25vw); }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Przycisk na hologramie — tam, gdzie spoczywa dłoń i rysik Izabeli */
.hero__cta {
  position: absolute; left: 77%; top: 85%; transform: translate(-50%, -50%); z-index: 3;
  font-size: 1.35rem; padding: 18px 42px;
  transition: transform .9s ease, box-shadow .3s ease;
}
/* strzałka rysowana w CSS — pojawia się z prawej i cały przycisk powoli odjeżdża */
.hero__cta::after {
  content: ''; display: inline-block; width: 0; height: 0;
  border-top: 8px solid transparent; border-bottom: 8px solid transparent;
  border-left: 12px solid currentColor;
  margin-left: 0; opacity: 0; transition: opacity .4s ease, margin-left .6s ease;
}
.hero__cta:hover {
  transform: translate(calc(-50% + 26px), -50%);
  box-shadow: 0 16px 40px rgba(79, 134, 198, .65);
}
.hero__cta:hover::after { opacity: 1; margin-left: 14px; }
.hero__cta:active { transform: translate(calc(-50% + 30px), -50%); }
/* Dymek w dolnym-lewym rogu kadru (pusta konsola) — pełny błękit, bez przezroczystości */
.hero__bubble { position: absolute; left: 3%; bottom: 6%; z-index: 3;
  max-width: min(420px, 42%); background: linear-gradient(135deg, #4f86c6, #74aee4);
  color: #fff; font-weight: 600; font-size: clamp(.95rem, 1.4vw, 1.1rem); line-height: 1.4;
  padding: 14px 18px; border-radius: 18px 18px 18px 4px; box-shadow: 0 14px 34px rgba(0,0,0,.45); }
@media (max-width: 640px) { .hero__cta { padding: 12px 20px; font-size: 1rem; } }

/* ---------- Intro: powitanie Izabeli (kadr + dymek) ---------- */
.greet-wrap { position: relative; max-width: 560px; margin: 4vh auto 0; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.greet-portrait { width: 240px; height: 240px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--accent); box-shadow: var(--glow-accent); background: #2a1f14; position: relative; }
.greet-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.greet-portrait.speaking::after { content: ''; position: absolute; inset: -8px; border-radius: 50%;
  border: 3px solid var(--accent-bright); animation: pulse 1.2s ease-out infinite; }

/* ---------- Animacja intro (wejście Izabeli) ---------- */
.intro-wrap { position: relative; min-height: 80vh; display: flex; flex-direction: column; align-items: center; }
.intro-skip { position: absolute; top: 0; right: 0; z-index: 5; }
.intro-stage {
  position: relative; width: 100%; max-width: 760px; height: 420px;
  margin: 12px auto 0; overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 300px at 70% 10%, rgba(155,107,255,.25), transparent 70%),
    linear-gradient(180deg, #11163a 0%, #1b1430 55%, #3a2a4a 100%);
  border: 1px solid var(--surface-border);
}
/* Powierzchnia planety/stacji */
.intro-platform {
  position: absolute; left: 0; right: 0; bottom: 0; height: 110px;
  background: linear-gradient(180deg, #5a4a6e, #3a2f4e);
  box-shadow: inset 0 8px 20px rgba(0,0,0,.35);
}
.intro-platform::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(3px 2px at 20% 40%, rgba(0,0,0,.25), transparent),
                    radial-gradient(4px 3px at 60% 70%, rgba(0,0,0,.2), transparent),
                    radial-gradient(3px 2px at 85% 30%, rgba(0,0,0,.25), transparent);
}
.intro-ramp {
  position: absolute; right: 130px; bottom: 95px;
  width: 220px; height: 18px;
  background: linear-gradient(90deg, #8b93b8, #c2c8de);
  transform: rotate(14deg); transform-origin: right center;
  border-radius: 4px; box-shadow: 0 6px 12px rgba(0,0,0,.4);
}
.intro-rocket { position: absolute; right: 8px; bottom: 70px; animation: rocketSettle 1.6s ease-out; }
@keyframes rocketSettle { 0% { transform: translateY(-40px); } 60% { transform: translateY(6px); } 100% { transform: translateY(0); } }
.intro-smoke { position: absolute; right: 40px; bottom: 70px; opacity: 0; }
.intro-smoke.on { opacity: 1; }
.intro-smoke i {
  position: absolute; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(220,220,235,.5); filter: blur(8px);
}
.intro-smoke.on i { animation: puff 2.2s ease-out infinite; }
.intro-smoke i:nth-child(2) { left: -30px; animation-delay: .3s; }
.intro-smoke i:nth-child(3) { left: 26px; animation-delay: .6s; }
.intro-smoke i:nth-child(4) { left: -10px; bottom: 20px; animation-delay: .9s; }
@keyframes puff { 0% { transform: scale(.4) translateY(0); opacity: .6; } 100% { transform: scale(1.6) translateY(-50px); opacity: 0; } }

/* Aktor — Izabela */
.iza-actor {
  position: absolute; right: 250px; bottom: 150px;
  width: 140px; transform-origin: bottom center;
  transition: transform 2.4s cubic-bezier(.4,0,.5,1), bottom 2.4s cubic-bezier(.4,0,.5,1), right 2.4s cubic-bezier(.4,0,.5,1);
  z-index: 3;
}
.iza-svg { display: block; }
/* Chód w dół podestu */
.iza-actor.walk { right: 150px; bottom: 70px; transform: rotate(-2deg); animation: bob .5s ease-in-out infinite; }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -4px; } }
/* Potknięcie */
.iza-actor.trip { transition: transform .25s ease; animation: stumble .6s ease; }
@keyframes stumble { 0%{transform:rotate(-2deg)} 30%{transform:rotate(8deg) translateY(4px)} 60%{transform:rotate(-6deg)} 100%{transform:rotate(4deg)} }
/* Upadek */
.iza-actor.fallen { transition: transform .5s cubic-bezier(.3,1.4,.6,1), bottom .5s ease; transform: rotate(82deg) translateX(-10px); bottom: 60px; }
/* Wstawanie */
.iza-actor.standup { transition: transform .9s cubic-bezier(.2,1.3,.5,1); transform: rotate(0deg); bottom: 70px; }
/* Otrzepywanie się — całe ciało drży */
.iza-actor.dust { animation: dust .35s ease-in-out 3; }
@keyframes dust { 0%,100%{transform:rotate(0)} 25%{transform:rotate(-3deg)} 75%{transform:rotate(3deg)} }
/* Odwrócenie twarzą do ekranu — lekkie przybliżenie */
.iza-actor.facing { transition: transform .7s ease, bottom .7s ease, right .7s ease; right: 50%; transform: translateX(50%) scale(1.25); bottom: 80px; }
.iza-actor.speaking { animation: talkBob 1s ease-in-out infinite; }
@keyframes talkBob { 0%,100%{transform:translateX(50%) scale(1.25)} 50%{transform:translateX(50%) scale(1.27) translateY(-3px)} }

/* Ramię ociera włosy w fazie 'dust' */
.iza-actor.dust #iza-arm-r { animation: wipeHair 1.1s ease-in-out; }
@keyframes wipeHair {
  0%{transform:rotate(0)} 30%{transform:rotate(-120deg)} 50%{transform:rotate(-110deg)}
  70%{transform:rotate(-125deg)} 100%{transform:rotate(0)}
}

/* Wyraz twarzy: domyślnie neutralny */
.mouth-grimace, .mouth-talk { opacity: 0; }
.iza-actor.dazed .mouth-neutral { opacity: 0; }
.iza-actor.dazed .mouth-grimace { opacity: 1; }
.iza-actor.dazed .iza-brow { transform: translateY(-1px) rotate(-3deg); transform-origin: center; }
.iza-actor.speaking .mouth-neutral, .iza-actor.speaking .mouth-grimace { opacity: 0; }
.iza-actor.speaking .mouth-talk { opacity: 1; animation: talkMouth .28s ease-in-out infinite; }
@keyframes talkMouth { 0%,100%{ry:1.5} 50%{ry:4} }

/* Napisy / dymek */
.intro-caption { min-height: 28px; margin-top: 16px; color: var(--text-dim); font-style: italic; text-align: center; }
.intro-bubble {
  margin-top: 8px; max-width: 460px; text-align: center;
  background: var(--bg-700); border: 1px solid var(--surface-border);
  padding: 16px 22px; border-radius: var(--radius-lg);
  font-family: var(--font-display); font-size: 1.15rem; position: relative;
}
.intro-bubble::before {
  content: ''; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 9px solid var(--bg-700);
}
.intro-bubble.pop { animation: bubblePop .35s cubic-bezier(.2,1.5,.5,1); }
@keyframes bubblePop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.intro-cta { margin-top: 18px; min-height: 56px; }

@media (max-width: 560px) {
  .intro-stage { height: 340px; }
  .iza-actor { right: 180px; }
  .iza-actor.walk { right: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  .iza-actor, .iza-actor * { animation: none !important; transition: none !important; }
}

/* ---------- Utility ---------- */
.fade-in { animation: fadeIn .35s ease; }
.pulse { animation: btnPulse 1.4s ease-in-out infinite; }
@keyframes btnPulse { 0%,100% { transform: scale(1); box-shadow: var(--glow-accent); } 50% { transform: scale(1.04); box-shadow: 0 0 36px rgba(255,122,24,.7); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }
.hidden { display: none !important; }
.spacer-sm { height: 8px; } .spacer { height: 20px; } .spacer-lg { height: 40px; }


/* ============================================================
   Ekran lekcji — PEŁNY EKRAN ze sceną jako tłem
   ============================================================ */
body.on-lessons { overflow: hidden; }
body.on-lessons .cosmos { display: none; }

.lessons-fs {
  position: fixed; inset: 0; z-index: 50;
  /* scena z OTWARTYMI oczami Izabeli (przy biurku, robot obok);
     background-size 106% przycina znaczek AI z rogu */
  background: url('../assets/scenes/scene-03.jpg') center 40% / 106% auto no-repeat;
  background-color: #0c1018;
  font-family: var(--font-body);
}
@media (max-aspect-ratio: 3/2) { .lessons-fs { background-size: cover; background-position: 50% 30%; } }
/* delikatne przyciemnienie góry i dołu dla czytelności napisów */
.lessons-fs::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6,10,18,.62) 0%, rgba(6,10,18,0) 26%),
    linear-gradient(0deg, rgba(6,10,18,.55) 0%, rgba(6,10,18,0) 24%);
}

/* Zdjęcie sceny — widoczne TYLKO w układzie kartowym na telefonie */
.scene-photo { display: none; }

.lessons-fs__top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(14px, 3vw, 32px);
}
/* logo „pogadaj.se" niepotrzebne na pełnoekranowych scenach — chowamy */
.lessons-fs__top .logo { display: none; }
.lessons-fs__tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lessons-fs__tools .btn {
  background: radial-gradient(ellipse at center, #ffffff 25%, #e3eef9 70%, #c4d8ea 100%);
  color: #16305a; border: 2px solid #16305a; border-radius: 10px;
  font-size: .85rem; padding: 8px 14px; backdrop-filter: none;
}
.lessons-fs__tools .btn:hover { box-shadow: 0 6px 16px rgba(6,25,55,.4); }
.account-pill { background: radial-gradient(ellipse at center, #ffffff 25%, #e3eef9 70%, #c4d8ea 100%); color: #16305a; border: 2px solid #16305a; border-radius: 10px; font-weight: 600; }

/* Dymek od ust Izabeli — luźne powitanie zamiast sztywnego nagłówka */
.lessons-fs__bubble {
  position: absolute; left: 57%; top: 86px; z-index: 3;
  width: min(36%, 430px); padding: 14px 18px;
  background: rgba(255,255,255,.96); color: #14314f;
  border: 2px solid #a5ddf3; border-radius: 18px;
  box-shadow: 0 14px 38px rgba(10,40,80,.45);
  font-size: clamp(.85rem, 1.35vw, 1rem); line-height: 1.45;
}
.lessons-fs__bubble::before {
  content: ''; position: absolute; left: -12px; bottom: 22%;
  width: 20px; height: 20px; transform: rotate(45deg);
  background: rgba(255,255,255,.96);
  border-left: 2px solid #a5ddf3; border-bottom: 2px solid #a5ddf3;
}
.lessons-fs__bubble-hi { font-family: var(--font-display); font-weight: 700; font-size: 1.1em; }
@media (max-width: 620px) {
  .lessons-fs__bubble { left: 50%; transform: translateX(-50%); top: 6%; width: 92%; }
  .lessons-fs__bubble::before { left: 50%; bottom: -12px; transform: translateX(-50%) rotate(-45deg); }
}

/* Kafelki lekcji — jedna pod drugą, po LEWEJ od Izabeli.
   Jasny środek, ciemniej przy krawędziach, granatowa ramka. */
.orbit-lesson {
  position: absolute; left: 3.5%; transform: translateY(-50%); z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: clamp(140px, 15vw, 190px); padding: 20px 14px; cursor: pointer;
  color: #14314f; text-align: center;
  background: radial-gradient(ellipse at center, #ffffff 25%, #e3eef9 62%, #b9d2e8 100%);
  border: 2px solid #16305a; border-radius: 10px;
  box-shadow: 0 12px 30px rgba(6,25,55,.5);
  transition: transform .18s ease, box-shadow .18s ease;
}
.orbit-lesson:hover, .orbit-lesson:focus-visible {
  transform: translateY(-50%) scale(1.06); outline: none;
  box-shadow: 0 0 24px rgba(120,190,255,.5), 0 16px 38px rgba(6,25,55,.55);
}
.orbit-lesson__num { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; line-height: 1; color: #16305a; }
.orbit-lesson__name { font-size: .95rem; color: #24486e; line-height: 1.15; font-weight: 600; }
.orbit-lesson__sub { font-size: .78rem; color: #5b7f9e; }
.orbit-lesson.is-done .orbit-lesson__num { color: #17b8ae; }
.orbit-lesson.is-locked { cursor: default; opacity: .8; filter: saturate(.6); }
.orbit-lesson.is-locked:hover { transform: translateY(-50%); box-shadow: 0 12px 30px rgba(6,25,55,.5); }

/* Wybór poziomu przed lekcjami próbnymi */
.level-overlay {
  position: absolute; inset: 0; z-index: 8;
  display: grid; place-items: center;
  background: rgba(6, 14, 28, .6); backdrop-filter: blur(4px);
}
.level-box {
  position: relative;
  width: min(92%, 560px); padding: 26px 28px; text-align: center;
  background: radial-gradient(ellipse at center, #ffffff 30%, #eaf3fb 70%, #cfe0ef 100%);
  border: 2px solid #16305a; border-radius: 12px;
  box-shadow: 0 24px 60px rgba(4,18,40,.6);
}
.level-close {
  position: absolute; top: 10px; right: 12px;
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  background: #eaf3fb; color: #16305a; border: 2px solid #16305a;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
}
.level-close:hover { background: #d9ecfa; }
.level-options { display: flex; flex-direction: column; gap: 12px; }
.level-opt {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 14px 18px; cursor: pointer;
  background: radial-gradient(ellipse at center, #ffffff 30%, #e3eef9 70%, #c4d8ea 100%);
  border: 2px solid #16305a; border-radius: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.level-opt:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(6,25,55,.35), 0 0 18px rgba(120,190,255,.4); }
.level-opt__title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: #16305a; }
.level-opt__desc { font-size: .88rem; color: #46688c; }

/* trzy pozycje: pionowa lista przy lewej krawędzi */
.orbit-pos-1 { top: 33%; }
.orbit-pos-2 { top: 51%; }
.orbit-pos-3 { top: 69%; }

/* Lekcja próbna: DUŻY kafelek + zegarek z pozostałym czasem pod spodem */
.trial-wrap {
  position: absolute; left: 27%; top: 44%; transform: translate(-50%, -50%); z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
/* telefon/pion: Izabela i kafelek na ŚRODKU, nie przy lewej krawędzi */
@media (max-width: 760px), (orientation: portrait) {
  .lessons-fs { background-size: cover; background-position: 50% 30%; }
  .trial-wrap { left: 50%; top: 62%; }
}
.trial-reset {
  margin-top: 2px; background: none; border: none; cursor: pointer;
  color: #dce9f5; font-size: .72rem; opacity: .55;
  text-decoration: underline; text-underline-offset: 3px;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.trial-reset:hover { opacity: 1; }
.trial-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  width: clamp(210px, 22vw, 300px); padding: 34px 22px; cursor: pointer;
  color: #14314f; text-align: center;
  background: radial-gradient(ellipse at center, #ffffff 25%, #e3eef9 62%, #b9d2e8 100%);
  border: 3px solid #16305a; border-radius: 12px;
  box-shadow: 0 14px 34px rgba(6,25,55,.5);
  transition: transform .18s ease, box-shadow .18s ease;
}
.trial-tile:hover { transform: scale(1.05); box-shadow: 0 0 26px rgba(120,190,255,.5), 0 18px 40px rgba(6,25,55,.55); }
.trial-tile__num { font-family: var(--font-display); font-weight: 700; font-size: 3rem; line-height: 1; color: #16305a; }
.trial-tile__name { font-family: var(--font-display); font-size: 1.05rem; color: #24486e; font-weight: 600; }
.trial-tile.is-locked { cursor: default; opacity: .85; filter: saturate(.6); }
.trial-tile.is-locked:hover { transform: none; }

.trial-clock { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.trial-clock__face {
  position: relative; width: 56px; height: 56px; border-radius: 50%;
  background: #eef6fd;                        /* wypełnienie ustawia inline conic-gradient */
  border: 3px solid #16305a; box-shadow: 0 8px 20px rgba(6,25,55,.45);
}
.trial-clock__hand {
  position: absolute; left: 50%; bottom: 50%; width: 3px; height: 20px;
  background: #16305a; border-radius: 2px; transform-origin: 50% 100%;
  margin-left: -1.5px;
}
.trial-clock__dot {
  position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
  transform: translate(-50%, -50%); border-radius: 50%; background: #16305a;
}
.trial-clock__label {
  background: rgba(255,255,255,.95); color: #16305a;
  border: 2px solid #16305a; border-radius: 10px;
  padding: 4px 14px; font-size: .85rem; font-weight: 600;
  box-shadow: 0 6px 16px rgba(6,25,55,.35);
}

/* info pod biurkiem Izabeli (dół sceny) — biel + błękit jak robot */
.lessons-fs__desk {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); z-index: 4;
  width: min(64%, 540px); padding: 13px 18px; text-align: center; color: #14314f;
  background: rgba(255,255,255,.93); backdrop-filter: blur(8px);
  border: 2px solid #aee0f5; border-radius: 16px;
  box-shadow: 0 14px 38px rgba(10,40,80,.45);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, border-color .2s ease;
}
.lessons-fs__desk.show { opacity: 1; border-color: #5fc6ee; transform: translateX(-50%) translateY(-3px); }
.lessons-fs__desk .muted { color: #46688c; }
.desk-hint { color: #5b7f9e; font-size: .92rem; }
.desk-status { font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: #1d9fd8; }
.desk-cta { margin-top: 6px; font-size: .84rem; color: #0e9fbf; font-weight: 600; }

/* telefon / wąskie ekrany — lista zostaje przy lewej, ciaśniej */
@media (max-width: 620px) {
  .lessons-fs { background-position: 60% center; }
  .lessons-fs__head { top: 8%; width: 92%; }
  .orbit-lesson { left: 3%; width: clamp(150px, 46vw, 210px); padding: 10px 12px; gap: 10px; }
  .orbit-lesson__num { font-size: 1.35rem; }
  .orbit-lesson__name { font-size: .8rem; }
  .orbit-pos-1 { top: 34%; }
  .orbit-pos-2 { top: 50%; }
  .orbit-pos-3 { top: 66%; }
  .lessons-fs__desk { width: 88%; bottom: 5%; }
}


/* ============================================================
   Finał triala (koty), pełna wersja (tablica) i historia lekcji
   ============================================================ */
.lessons-fs--cats {
  background: url('../assets/scenes/scene-01.jpg') center 32% / cover no-repeat;
}
.lessons-fs__bubble--end { left: 50%; top: 10%; transform: translateX(-50%); width: min(92%, 560px); cursor: default; }

/* Pełna wersja: tło (wybierane per-wejście w JS), na wierzchu kompaktowy
   panel z czasem w bezpiecznym rogu + kolumna przycisków ustawiana per-scena */
.home-fs {
  position: fixed; inset: 0; z-index: 50;
  background: #0c1018 center 30% / cover no-repeat;
  font-family: var(--font-body);
}
/* kontener pozycjonujący — wygląd daje wspólna .time-board */
.home-board { z-index: 3; position: absolute; left: 2%; top: 11%; }

/* Wspólna tablica czasu (pełna wersja i lekcja próbna) — spójny wygląd,
   pasek postępu zamiast zegara, bez procentów pod spodem. */
.time-board {
  width: min(300px, 88vw); text-align: center; color: #16305a;
  background: radial-gradient(ellipse at center, #ffffff 25%, #e3eef9 70%, #c4d8ea 100%);
  border: 2px solid #16305a; border-radius: 14px; padding: 12px 16px;
  box-shadow: 0 12px 30px rgba(6,25,55,.4);
}
.time-board__label { font-family: var(--font-display); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: #24486e; }
.time-board__time { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 3.2vw, 2.1rem); line-height: 1.1; color: #16305a; margin: 2px 0 9px; }
.time-board__bar { height: 12px; border-radius: 8px; background: #dce9f5; overflow: hidden; border: 1px solid #9fc0dd; }
.time-board__bar > i { display: block; height: 100%; background: linear-gradient(90deg, #4f86c6, #7fd6ff); }

/* Kolumna przycisków (historia + akcje) — pozycję nadaje JS per-scena */
.home-controls {
  position: absolute; z-index: 4;
  display: flex; flex-direction: column; gap: 10px; max-width: min(340px, 44vw);
}

/* Dymek „co mówi Izabela" na pełnoekranowych scenach — pozycja per-scena z JS.
   Zawsze widoczny gdy Izabela mówi, nigdy nie zasłania twarzy ani kotów. */
.scene-bubble {
  position: absolute; z-index: 5; cursor: pointer;
  width: max-content; max-width: min(340px, 40vw);
  background: radial-gradient(ellipse at center, #ffffff 30%, #eef6fd 78%, #dcebf8 100%);
  border: 2px solid #16305a; border-radius: 12px; padding: 10px 14px; color: #14314f;
  box-shadow: 0 12px 30px rgba(6,25,55,.42);
  max-height: 42vh; overflow: hidden;   /* dymek zmienia się automatycznie, bez ręcznego scrolla */
}
@media (max-width: 760px), (orientation: portrait) {
  .scene-bubble { max-width: 92%; max-height: 30vh; }
}
.scene-bubble__who { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #5b7f9e; margin-bottom: 2px; }
.scene-bubble__hi { font-family: var(--font-display); font-weight: 700; color: #14314f; }

/* Historia: Izabela rysuje przy konsoli (scene-17) */
.history-fs {
  position: fixed; inset: 0; z-index: 50;
  background: #0c1018 url('../assets/scenes/scene-17.jpg') center 30% / cover no-repeat;
  font-family: var(--font-body);
}
/* Okienka lekcji w kolumnie po PRAWEJ stronie (dolna część = biurko),
   nie zasłaniają twarzy Izabeli ani kotów. Zwinięte = tytuł, klik rozwija. */
.history-cards {
  position: absolute; right: 1.5%; top: 50%; bottom: 5%; z-index: 4;
  width: min(320px, 40vw);
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  overflow-y: auto;
}
.history-item {
  width: max-content; max-width: 100%;
  background: radial-gradient(ellipse at center, #ffffff 30%, #eaf3fb 75%, #d9e8f4 100%);
  border: 2px solid #16305a; border-radius: 10px; padding: 7px 12px;
  box-shadow: 0 10px 26px rgba(6,25,55,.4);
  cursor: pointer;
}
.history-item .history-item__sum { display: none; }
.history-item.open { width: 100%; padding: 10px 12px; }
.history-item.open .history-item__sum { display: block; }
.history-item__head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.history-item__kind { font-family: var(--font-display); font-weight: 700; color: #16305a; }
.history-item__meta { font-size: .78rem; color: #5b7f9e; }
.history-item__sum { margin: 6px 0 0; font-size: .88rem; color: #2c4a68; }

/* Okno profilu użytkownika — jasne pola na jasnym okienku */
.profile-box { text-align: left; }
.profile-box .field { margin-bottom: 12px; }
.profile-box .field label { color: #46688c; }
.profile-box .field input {
  background: #f2f8fd; color: #14314f;
  border: 1px solid #cfe6f8; border-radius: 10px;
}
.profile-box .field input:focus { border-color: #1d9fd8; }
.profile-box .field input::placeholder { color: #8aa5bf; }

/* Rożek „zostaw opinię Izabeli!" + okienko opinii */
.feedback-corner {
  position: fixed; right: 14px; bottom: 14px; z-index: 90;
  background: radial-gradient(ellipse at center, #ffffff 25%, #e3eef9 70%, #c4d8ea 100%);
  color: #16305a;
  border: 2px solid #16305a; border-radius: 10px;
  padding: 7px 12px; font-size: .8rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 20px rgba(6,25,55,.35);
}
.feedback-corner:hover { box-shadow: 0 10px 24px rgba(6,25,55,.45), 0 0 14px rgba(120,190,255,.4); }
.feedback-box { text-align: left; }
.feedback-text {
  width: 100%; min-height: 140px; resize: vertical;
  border: 2px solid #cfe6f8; border-radius: 10px; padding: 12px 14px;
  font-family: var(--font-body); font-size: .95rem; color: #14314f;
  background: #f7fbff; margin-bottom: 12px;
}
.feedback-text::placeholder { color: #8aa5bf; font-style: italic; transform: skewX(-6deg); }
.feedback-text:focus { outline: none; border-color: #1d9fd8; }
.feedback-sign {
  width: 100%; padding: 12px 14px; margin-bottom: 12px;
  border: 2px solid #cfe6f8; border-radius: 10px;
  font-family: var(--font-body); font-size: .95rem; color: #14314f; background: #f7fbff;
}
.feedback-sign::placeholder { color: #8aa5bf; }
.feedback-sign:focus { outline: none; border-color: #1d9fd8; }

@media (max-width: 760px), (orientation: portrait) {
  /* Na telefonie kadr jest przycięty — układamy UI w bezpieczne pasy
     (góra/dół), nadpisując pozycje ustawiane inline w JS. */
  .home-board { left: 50% !important; top: 9% !important; transform: translateX(-50%) !important; display: flex; justify-content: center; width: auto !important; }
  .home-controls {
    left: 50% !important; right: auto !important; top: auto !important;
    bottom: 3% !important; transform: translateX(-50%) !important;
    align-items: stretch !important; width: 92%; max-width: 92%;
  }
  .scene-bubble {
    left: 50% !important; right: auto !important; top: auto !important; bottom: 22% !important;
    transform: translateX(-50%) !important; max-width: 92%; width: 92%;
  }
  /* Na home dymek na DOLE (nad przyciskami), żeby środek ekranu z twarzą
     Izabeli został odsłonięty. Tablica u góry, przyciski pod dymkiem. */
  .home-fs .scene-bubble {
    top: auto !important; bottom: 19% !important; max-height: 28vh;
  }
  /* Historia: czysty pionowy układ — pasek, dymek, potem lista lekcji.
     Wszystko w normalnym przepływie (przewijane), nic się nie nakłada. */
  .history-fs { overflow-y: auto; }
  .history-fs .scene-bubble {
    position: static !important; left: auto !important; top: auto !important; bottom: auto !important;
    transform: none !important; margin: 64px 14px 10px !important; width: auto !important; max-width: none !important;
    max-height: none !important;
  }
  .history-cards {
    position: static; display: flex; flex-direction: column; gap: 10px;
    inset: auto; padding: 0 14px 30px; overflow: visible; max-height: none; width: auto;
  }
  .history-item { position: static !important; width: 100%; max-width: 100%; }
}

/* ===== TELEFON: układ KARTOWY — zdjęcie na górze, treść pod spodem ===== */
@media (max-width: 640px) {
  /* Sceny pełnoekranowe stają się przewijaną kolumną: zdjęcie + treść.
     Nic się nie nakłada ani nie zasłania twarzy Izabeli. */
  .home-fs, .history-fs, .lessons-fs {
    display: flex !important; flex-direction: column !important;
    overflow-y: auto !important; -webkit-overflow-scrolling: touch;
    /* JASNE tło pod zdjęciem — treść i dymek ładnie się wybijają */
    background: #e7f0fa !important; padding-bottom: 74px;
  }
  /* na jasnym tle przyciski górnego paska w ciemniejszej ramce (widoczne) */
  .lessons-fs__top { background: #dbe8f5; }
  .home-fs::before, .history-fs::before, .lessons-fs::before { display: none !important; }
  /* Całe zdjęcie sceny (16:9) — widać też koty, nic nie przycinamy z boków */
  .scene-photo { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; flex: none; }

  /* Pasek górny jako zwykły rząd nad zdjęciem */
  .lessons-fs__top { position: static !important; padding: 10px 12px; }
  .lessons-fs__tools { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .lessons-fs__tools .btn { font-size: .74rem; padding: 6px 9px; }

  /* Cała treść w normalnym przepływie pod zdjęciem (bez pozycji absolutnych) */
  .home-board, .home-controls, .scene-bubble, .history-cards,
  .trial-wrap, .lessons-fs__bubble, .trial-clock {
    position: static !important; inset: auto !important;
    left: auto !important; right: auto !important; top: auto !important; bottom: auto !important;
    transform: none !important; width: auto !important; max-width: none !important;
    max-height: none !important; margin: 10px 14px !important;
  }
  .home-board { display: flex !important; justify-content: center; }
  /* przyciski home na pełną szerokość karty (wyśrodkowane, nie do lewej) */
  .home-controls { display: flex !important; flex-direction: column; gap: 10px; align-items: stretch !important; }
  .home-controls > .btn { width: 100%; justify-content: center; }
  .history-cards { display: flex; flex-direction: column; gap: 10px; }
  .history-item { position: static !important; width: 100% !important; max-width: 100% !important; }
  .trial-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
  .scene-bubble, .lessons-fs__bubble { box-shadow: 0 8px 22px rgba(6,25,55,.3); }
  .lessons-fs__bubble::before, .iza-card__bubble::before { display: none; }

  /* Kolejność: zdjęcie → dymek (łącznik) → tablica czasu → przyciski */
  .lessons-fs__top { order: 0; }
  .scene-photo { order: 1; }
  .scene-bubble, .lessons-fs__bubble { order: 2; }
  .home-board, .trial-wrap, .history-cards { order: 3; }
  .home-controls { order: 4; }

  /* Dymek jako ŁĄCZNIK zdjęcia z treścią: wchodzi na dół zdjęcia,
     ogonek celuje w górę w Izabelę; większy i czytelniejszy */
  .scene-bubble, .lessons-fs__bubble {
    margin: -20px 12px 10px !important; position: relative; z-index: 2;
    align-self: stretch !important;                       /* pełna szerokość karty */
    width: auto !important; max-width: none !important; min-width: 0 !important;
    box-sizing: border-box; min-height: 120px;            /* zawsze porządna wysokość */
    display: flex; flex-direction: column; justify-content: center;
    font-size: 1.14rem !important; line-height: 1.55; padding: 20px 20px !important;
    border-radius: 16px !important; border-width: 2px;
    background: #ffffff !important;
    box-shadow: 0 12px 30px rgba(6,25,55,.28) !important;
  }
  .scene-bubble__who { font-size: .82rem; }
  .scene-bubble__hi { font-size: 1.28rem; margin-bottom: 2px; }
  .scene-bubble p, .lessons-fs__bubble p { margin: 4px 0 0; }
  .scene-bubble::after, .lessons-fs__bubble::after {
    content: ''; position: absolute; top: -9px; left: 28px;
    width: 16px; height: 16px; transform: rotate(45deg); background: #ffffff;
  }
  .scene-bubble::after { border-left: 2px solid #16305a; border-top: 2px solid #16305a; }
  .lessons-fs__bubble::after { border-left: 2px solid #a5ddf3; border-top: 2px solid #a5ddf3; }

  /* Widok lekcji: większe, czytelniejsze dymki i więcej miejsca na czat */
  .lc-stage { min-height: 30vh !important; }
  .lc-main { padding: 12px 14px 16px; }
  .lc-main .chat { max-height: none !important; padding-left: 6px; }
  body.in-lesson .msg--izabela, body.in-lesson .msg--user { font-size: .98rem; line-height: 1.5; padding: 10px 12px; }
  .lesson-chat-card h2 { font-size: 1.05rem; }
  .mic-btn { font-size: 1rem; }

  /* Karta Izabeli (onboarding/test): dymek na obrazie krótki i przy dole */
  .iza-card__bubble { font-size: .84rem; padding: 7px 10px; max-height: 40%; }
  .iza-card__stage { min-height: 210px; }
}
