/* aj.cz – design */

:root {
  --bg: #f6f5ff;
  --bg-2: #eeecff;
  --card: #ffffff;
  --text: #1c1a33;
  --muted: #6b6889;
  --line: #e4e1f5;
  --primary: #6d5efc;
  --primary-2: #8b7dff;
  --primary-ink: #ffffff;
  --accent: #ff5c8a;
  --amber: #ffb020;
  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --bad: #e11d48;
  --bad-bg: #ffe4e9;
  --shadow: 0 1px 2px rgba(28, 26, 51, 0.06), 0 8px 24px rgba(28, 26, 51, 0.07);
  --shadow-lg: 0 20px 50px rgba(64, 50, 180, 0.18);
  --radius: 18px;
  --radius-sm: 12px;
  --grad: linear-gradient(120deg, #6d5efc 0%, #a855f7 50%, #ff5c8a 100%);
  --header-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e1a;
    --bg-2: #171528;
    --card: #1b1930;
    --text: #efedff;
    --muted: #a19dc2;
    --line: #2c2948;
    --primary: #8b7dff;
    --primary-2: #a79cff;
    --ok: #4ade80;
    --ok-bg: #11301e;
    --bad: #fb7185;
    --bad-bg: #3a1420;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0e1a;
  --bg-2: #171528;
  --card: #1b1930;
  --text: #efedff;
  --muted: #a19dc2;
  --line: #2c2948;
  --primary: #8b7dff;
  --primary-2: #a79cff;
  --ok: #4ade80;
  --ok-bg: #11301e;
  --bad: #fb7185;
  --bad-bg: #3a1420;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 800; margin-top: 1.6em; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 0.8em; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 999; background: var(--card); padding: 0.5rem 1rem; border-radius: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 2px; }

.icon { display: inline-flex; width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.icon svg { width: 100%; height: 100%; }

/* ---------- Header ---------- */
#header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { max-width: 1360px; margin: 0 auto; height: var(--header-h); display: flex; align-items: center; gap: 1rem; padding: 0 16px; }
.logo { display: flex; align-items: baseline; font-weight: 800; font-size: 1.45rem; letter-spacing: -0.04em; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-dot { color: var(--muted); font-weight: 700; }
.main-nav { display: flex; gap: 0.25rem; margin-left: 1rem; }
.main-nav a { display: flex; align-items: center; gap: 0.45rem; white-space: nowrap; padding: 0.5rem 0.8rem; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.main-nav a:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }
.main-nav a.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.pill { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.3rem 0.7rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 0.9rem; color: var(--text); white-space: nowrap; }
.pill small { color: var(--muted); font-weight: 600; }
.pill.streak { color: var(--muted); }
.pill.streak.on { color: #f97316; border-color: color-mix(in srgb, #f97316 35%, var(--line)); }
.pill.premium { background: linear-gradient(120deg, #ffcf4d, #ffb020); color: #4a3200; border: none; }
.pill.premium:hover { text-decoration: none; filter: brightness(1.05); }
.lang-switch { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang-switch button { display: inline-flex; align-items: center; gap: .35em; border: 0; background: none; padding: 0.25rem 0.55rem; border-radius: 999px; font-weight: 800; font-size: 0.8rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.lang-switch button.active { background: var(--primary); color: #fff; }
.lang-switch .flag { width: 1.25em; height: .85em; }
.lang-switch button:not(.active) .flag { opacity: .75; }
.lang-switch button:hover .flag { opacity: 1; }
.avatar-btn, .avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; }
.avatar-btn:hover { text-decoration: none; }
.avatar.big { width: 72px; height: 72px; font-size: 1.8rem; }

#tabbar { display: none; }

/* ---------- Layout ---------- */
#view { flex: 1; width: 100%; outline: none; }
.page { max-width: 1100px; margin: 0 auto; padding: 28px 16px 60px; }
.page-head { margin-bottom: 1.5rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 70ch; }
.page-head.center .lead { margin-inline: auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.notice { background: color-mix(in srgb, var(--primary) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line)); border-radius: var(--radius-sm); padding: 0.8rem 1rem; margin-bottom: 1rem; }
.notice.success { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.back-link { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); font-weight: 600; margin-bottom: 1rem; }
.loading { display: grid; place-items: center; min-height: 50vh; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; border: 0; border-radius: 14px; padding: 0.75rem 1.25rem; font-weight: 700; cursor: pointer; transition: transform 0.08s, box-shadow 0.15s, background 0.15s, filter 0.15s; text-decoration: none !important; white-space: nowrap; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 4px 0 color-mix(in srgb, var(--primary) 70%, #000); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn-ghost { background: var(--card); color: var(--text); border: 1.5px solid var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--ok); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--ok) 70%, #000); }
.btn-danger { background: var(--bad); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--bad) 70%, #000); }
.btn.small { padding: 0.45rem 0.85rem; font-size: 0.88rem; border-radius: 10px; }
.btn.big { padding: 0.95rem 1.5rem; font-size: 1.05rem; border-radius: 16px; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--bad); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font-weight: 600; }
.chip { border: 1.5px solid var(--line); background: var(--card); padding: 0.4rem 0.85rem; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--text); }
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ---------- Home ---------- */
.home { max-width: 1180px; margin: 0 auto; padding: 0 16px 40px; }
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 2rem; align-items: center; padding: 56px 0 40px; }
.hero.compact { padding-top: 24px; }
.eyebrow { display: inline-block; font-weight: 700; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.85rem; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4rem); margin: 0.4em 0 0.3em; letter-spacing: -0.04em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.5rem 0; }
.hero-stats { display: flex; gap: 1.8rem; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 1.5rem; font-weight: 800; }
.hero-stats span { color: var(--muted); font-size: 0.9rem; }
.hero-visual { position: relative; min-height: 340px; background: var(--grad); border-radius: 32px; padding: 32px 24px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.hero-visual::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 10%, rgba(255,255,255,0.35), transparent 40%); pointer-events: none; }
.bubble-demo { position: relative; z-index: 1; background: #fff; color: #1c1a33; padding: 0.8rem 1rem; border-radius: 18px; max-width: 85%; font-weight: 600; box-shadow: 0 8px 20px rgba(0,0,0,0.15); animation: floatIn 0.6s both; }
.bubble-demo .who { display: block; font-size: 0.75rem; color: #6d5efc; font-weight: 800; }
.bubble-demo.b2 { align-self: flex-end; background: #1c1a33; color: #fff; animation-delay: 0.3s; }
.bubble-demo.b2 .who { color: #ffb4c8; }
.bubble-demo.b3 { background: #fff7e0; animation-delay: 0.6s; }
.bubble-demo.b3 small { margin-left: 0.5rem; color: #8a6d1d; }
.floating { position: absolute; z-index: 2; background: #fff; color: #1c1a33; border-radius: 999px; padding: 0.35rem 0.8rem; font-weight: 800; box-shadow: 0 8px 20px rgba(0,0,0,0.15); animation: bob 3s ease-in-out infinite; }
.floating.f1 { top: 18px; right: 22px; }
.floating.f2 { bottom: 22px; left: 22px; animation-delay: 1s; color: #6d5efc; }
.floating.f3 { bottom: 26px; right: 30px; animation-delay: 2s; color: #16a34a; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes floatIn { from { opacity: 0; transform: translateY(12px); } }

.dash { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding-top: 28px; }
.dash-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); display: flex; gap: 1rem; align-items: center; }
.dash-card h3 { margin: 0 0 0.2rem; }
.dash-card p { margin: 0; }
.big-emoji { font-size: 2.3rem; }
.dash-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.action-card { display: flex; flex-direction: column; gap: 0.2rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; color: var(--text); box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s; }
.action-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.action-card.primary { background: var(--grad); color: #fff; border: 0; }
.action-card span:last-child { font-size: 0.88rem; opacity: 0.8; }
.ac-emoji { font-size: 1.8rem; }

.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg-2); stroke-width: 9; }
.ring-fg { fill: none; stroke: url(#none); stroke: var(--primary); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 0.8s; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-label b { font-size: 1.2rem; }
.ring-label span { font-size: 0.7rem; color: var(--muted); }

.features { padding: 40px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.feature p { color: var(--muted); margin: 0; }
.f-emoji { font-size: 2rem; margin-bottom: 0.4rem; }

.level-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-top: 1.5rem; }
.level-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; color: var(--text); box-shadow: var(--shadow); transition: transform 0.15s; }
.level-card:hover { transform: translateY(-4px); text-decoration: none; }
.lv-badge { display: inline-block; font-weight: 800; font-size: 1.3rem; padding: 0.2rem 0.7rem; border-radius: 10px; color: #fff; margin-bottom: 0.5rem; }
.lv-A1 .lv-badge, .lv.lv-A1 { background: #22c55e; }
.lv-A2 .lv-badge, .lv.lv-A2 { background: #0ea5e9; }
.lv-B1 .lv-badge, .lv.lv-B1 { background: #8b5cf6; }
.lv-B2 .lv-badge, .lv.lv-B2 { background: #f43f5e; }
.lv-C1 .lv-badge, .lv.lv-C1 { background: #1c1a33; }
:root[data-theme="dark"] .lv.lv-C1, :root[data-theme="dark"] .lv-C1 .lv-badge { background: #f59e0b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lv.lv-C1, :root:not([data-theme="light"]) .lv-C1 .lv-badge { background: #f59e0b; } }
.option.en-opt { font-size: 1.2rem; letter-spacing: 0.01em; }
.lv-name { font-weight: 700; }

.pricing-teaser { margin: 40px 0; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 1.8rem 2rem; box-shadow: var(--shadow); }
.pricing-teaser h2 { margin-top: 0; }
.pricing-teaser p { margin: 0; }

.faq { max-width: 760px; margin: 0 auto; padding: 20px 0; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; margin-bottom: 0.6rem; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: 0.6rem 0 0; color: var(--muted); }

/* ---------- Topics ---------- */
.filters { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.4rem; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.topic-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; color: var(--text); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.35rem; transition: transform 0.15s, box-shadow 0.15s; }
.topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.topic-card.locked { opacity: 0.78; }
.topic-card.locked .tc-icon { filter: grayscale(0.6); }
.tc-top { display: flex; justify-content: space-between; align-items: center; }
.tc-icon { font-size: 2rem; }
.lv { color: #fff; font-weight: 800; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 7px; }
.tc-title { font-weight: 800; font-size: 1.05rem; }
.tc-meta { color: var(--muted); font-size: 0.85rem; }
.tc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 0.2rem; }
.lock { color: #b7791f; font-weight: 700; font-size: 0.85rem; }
.free-badge { font-size: 0.72rem; font-weight: 800; color: var(--ok); background: var(--ok-bg); padding: 0.1rem 0.5rem; border-radius: 6px; text-transform: uppercase; }
.progress { height: 12px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.progress.thin { height: 7px; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width 0.4s; }

.topic-head { display: flex; gap: 1.2rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 1.4rem; box-shadow: var(--shadow); }
.topic-head h1 { margin-bottom: 0.1em; }
.th-icon { font-size: 3.6rem; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.9rem; }
.mode-card { display: flex; flex-direction: column; gap: 0.2rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; color: var(--text); box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s; }
.mode-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.mode-card.primary { background: var(--grad); color: #fff; border: 0; }
.mode-card span { font-size: 0.85rem; opacity: 0.8; }
.mc-icon { font-size: 1.8rem; }
.wordlist { margin-top: 2rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.wordlist summary { font-weight: 800; cursor: pointer; }
.words { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.2rem 1rem; margin-top: 0.8rem; }
.word-row { display: flex; gap: 0.5rem; align-items: center; padding: 0.15rem 0; border-bottom: 1px dashed var(--line); }
.word-row .icon-btn { width: 32px; height: 32px; }

/* ---------- Lesson ---------- */
body.in-lesson #footer, body.in-lesson #tabbar { display: none !important; }
.lesson { max-width: 760px; margin: 0 auto; min-height: calc(100vh - var(--header-h)); display: flex; flex-direction: column; padding: 16px 16px 0; }
.lesson-top { display: flex; align-items: center; gap: 0.8rem; }
.lesson-top .progress { flex: 1; }
.combo { min-width: 64px; text-align: right; }
.combo-badge { display: inline-flex; align-items: center; gap: 0.15rem; font-weight: 800; color: #f97316; animation: pop 0.3s; }
.lesson-body { flex: 1; padding: 26px 0; }
.q-card.enter { animation: slideIn 0.3s both; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } }
@keyframes pop { 40% { transform: scale(1.3); } }
.q-prompt { font-size: 1.35rem; font-weight: 800; margin-bottom: 1.2rem; }
.q-body { display: flex; flex-direction: column; gap: 1rem; }
.q-word { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; }
.q-word small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.q-word.number { font-variant-numeric: tabular-nums; font-size: 3rem; }
.q-sentence { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 1.35rem; font-weight: 700; }
.q-native { font-size: 1.2rem; font-weight: 700; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; }
.q-native.big { font-size: 1.35rem; }
.q-hint { color: var(--muted); font-style: italic; }
.q-listen { display: flex; justify-content: center; padding: 0.5rem 0; }
.q-clock { display: flex; align-items: center; gap: 1.5rem; justify-content: center; }
.clock { width: 150px; height: 150px; color: var(--text); }
.digital { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.gap-blank { display: inline-block; min-width: 4ch; border-bottom: 3px solid var(--primary); color: transparent; margin: 0 0.2em; }
.audio-btns { display: inline-flex; gap: 0.4rem; }
.btn-audio { width: 48px; height: 48px; border-radius: 14px; border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 0 color-mix(in srgb, var(--primary) 70%, #000); }
.btn-audio .icon { width: 24px; height: 24px; }
.btn-audio.slow { background: var(--card); color: var(--primary); border: 1.5px solid var(--line); box-shadow: none; }
.audio-btns.big .btn-audio { width: 96px; height: 96px; border-radius: 28px; }
.audio-btns.big .btn-audio .icon { width: 44px; height: 44px; }
.audio-btns.big .btn-audio.slow { width: 64px; height: 64px; align-self: end; }
.options { display: flex; flex-direction: column; gap: 0.6rem; }
.options.grid { display: grid; grid-template-columns: 1fr 1fr; }
.options.two { grid-template-columns: 1fr 1fr; }
.option { display: flex; align-items: center; gap: 0.8rem; text-align: left; background: var(--card); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; padding: 0.85rem 1rem; cursor: pointer; font-weight: 700; font-size: 1.05rem; transition: border-color 0.12s, background 0.12s, transform 0.08s; }
.option:hover:not(:disabled) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--card)); }
.option:active:not(:disabled) { transform: translateY(2px); }
.option.big { justify-content: center; font-size: 1.4rem; padding: 1.2rem; }
.option.long { font-weight: 600; }
.option .kbd { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 0.8rem; color: var(--muted); }
.option.correct { border-color: var(--ok); background: var(--ok-bg); }
.option.wrong { border-color: var(--bad); background: var(--bad-bg); animation: shake 0.35s; }
.option:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.answer-input { width: 100%; border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 0.9rem 1rem; font-size: 1.15rem; resize: vertical; }
.answer-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.tiles { display: flex; flex-wrap: wrap; gap: 0.5rem; min-height: 56px; }
.answer-row { border-bottom: 2px solid var(--line); padding-bottom: 0.8rem; min-height: 64px; }
.bank { padding-top: 0.4rem; }
.tile { background: var(--card); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; padding: 0.5rem 0.85rem; font-weight: 700; font-size: 1.05rem; cursor: pointer; animation: pop 0.2s; }
.tile:hover { border-color: var(--primary); }

.speak { align-items: center; text-align: center; }
.speak-target { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.speak-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800; }
.speak-words .ok { color: var(--ok); }
.speak-words .miss { color: var(--bad); text-decoration: underline wavy; text-underline-offset: 5px; }
.mic { width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-lg); transition: transform 0.15s; }
.mic .icon { width: 40px; height: 40px; }
.mic:hover:not(:disabled) { transform: scale(1.05); }
.mic:disabled { opacity: 0.4; cursor: not-allowed; }
.mic.recording { animation: pulse 1.2s infinite; background: var(--bad); }
.mic.small { width: 48px; height: 48px; flex: none; }
.mic.small .icon { width: 22px; height: 22px; }
.mic.tiny { width: 38px; height: 38px; }
.mic.tiny .icon { width: 18px; height: 18px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 55%, transparent); } 100% { box-shadow: 0 0 0 24px transparent; } }
.speak-status { font-weight: 700; color: var(--muted); min-height: 1.5em; }
.speak-score b { font-size: 1.3rem; }
.ai-box { text-align: left; background: color-mix(in srgb, var(--primary) 8%, var(--card)); border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line)); border-radius: var(--radius-sm); padding: 0.8rem 1rem; width: 100%; }
.ai-box p:last-child, .ai-box ul:last-child { margin-bottom: 0; }
.ai-label { font-weight: 800; color: var(--primary); margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.3rem; }
.ipa { font-family: 'Segoe UI', 'Lucida Sans Unicode', sans-serif; color: var(--muted); }
.better { font-weight: 700; }

.lesson-foot { position: sticky; bottom: 0; margin: 0 -16px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.foot-inner { display: flex; justify-content: space-between; gap: 1rem; }
.foot-inner .btn-primary { min-width: 180px; }
.feedback { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin: -14px -16px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); animation: up 0.25s both; }
@keyframes up { from { transform: translateY(20px); opacity: 0; } }
.fb-ok { background: var(--ok-bg); }
.fb-wrong { background: var(--bad-bg); }
.fb-main { display: flex; gap: 0.9rem; align-items: flex-start; min-width: 0; }
.fb-icon { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--card); }
.fb-ok .fb-icon { color: var(--ok); }
.fb-wrong .fb-icon { color: var(--bad); }
.fb-icon .icon { width: 26px; height: 26px; }
.fb-title { font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: 0.6rem; }
.fb-ok .fb-title { color: var(--ok); }
.fb-wrong .fb-title { color: var(--bad); }
.xp-pop { font-size: 0.85rem; background: var(--amber); color: #4a3200; padding: 0.1rem 0.5rem; border-radius: 999px; animation: pop 0.4s; }
.fb-answer { margin-top: 0.15rem; }
.fb-extra .rule { margin: 0.4rem 0 0; font-size: 0.95rem; }
.fb-extra .ai-box { margin-top: 0.5rem; }
.fb-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }
.fb-actions .btn-ghost { background: color-mix(in srgb, var(--card) 80%, transparent); }

.lesson-end { max-width: 640px; margin: 0 auto; padding: 40px 16px 60px; text-align: center; }
.lesson-end.compact { padding: 20px 0; }
.end-emoji { font-size: 4.5rem; animation: pop 0.6s; }
.end-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; margin: 1.5rem 0; }
.end-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 0.4rem; box-shadow: var(--shadow); }
.es-emoji { font-size: 1.4rem; }
.es-value { font-size: 1.4rem; font-weight: 800; }
.es-label { font-size: 0.78rem; color: var(--muted); }
.streak-line { font-weight: 700; color: #f97316; }
.ach-new { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.ach-chip { background: linear-gradient(120deg, #fff4cc, #ffe08a); color: #4a3200; padding: 0.4rem 0.9rem; border-radius: 999px; font-weight: 800; animation: pop 0.5s; }
.mistakes { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0; }
.mistake { display: flex; gap: 0.8rem; align-items: center; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 0.35rem 0; }
.mistake span { color: var(--muted); flex: 1; }
.end-actions { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.big-line { font-size: 1.2rem; font-weight: 700; }
.xp-line { font-size: 1.4rem; font-weight: 800; color: var(--primary); }

/* ---------- Games ---------- */
.game { max-width: 860px; margin: 0 auto; padding: 16px 16px 40px; }
.game-top { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.game-top h2 { margin: 0; font-size: 1.2rem; }
.game-stats { display: flex; justify-content: center; gap: 1.5rem; font-weight: 800; font-size: 1.15rem; margin: 0.5rem 0; }
.pexeso { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; perspective: 900px; }
.pcard { position: relative; aspect-ratio: 4 / 3; border: 0; background: none; cursor: pointer; transform-style: preserve-3d; transition: transform 0.4s; padding: 0; }
.pcard.flipped { transform: rotateY(180deg); }
.pcard > span { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 14px; display: grid; place-items: center; padding: 0.4rem; font-weight: 800; text-align: center; font-size: clamp(0.8rem, 2.2vw, 1.05rem); word-break: break-word; }
.pfront { background: var(--grad); color: #fff; font-size: 2rem !important; box-shadow: var(--shadow); }
.pback { background: var(--card); border: 2px solid var(--line); transform: rotateY(180deg); }
.pcard.en .pback { color: var(--primary); }
.pcard.matched .pback { border-color: var(--ok); background: var(--ok-bg); animation: pop 0.4s; }
.speed-card { margin: 1.5rem auto; max-width: 480px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 2rem 1rem; text-align: center; box-shadow: var(--shadow-lg); transition: background 0.2s; }
.speed-card.pop { animation: pop 0.25s; }
.speed-card.flash-ok { background: var(--ok-bg); }
.speed-card.flash-bad { background: var(--bad-bg); }
.speed-en { font-size: 2.2rem; font-weight: 800; color: var(--primary); }
.speed-eq { color: var(--muted); font-size: 1.4rem; }
.speed-nat { font-size: 1.8rem; font-weight: 800; }
.speed-btns { display: flex; justify-content: center; gap: 1rem; }
.timebar { max-width: 480px; margin: 0 auto; }
.hang-hint { text-align: center; font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.balloons { display: flex; justify-content: center; gap: 0.5rem; height: 90px; align-items: flex-end; }
.balloon { width: 38px; height: 50px; background: var(--c); border-radius: 50% 50% 48% 48%; position: relative; animation: bob 2.5s ease-in-out infinite; transition: transform 0.3s, opacity 0.3s; }
.balloon:nth-child(2n) { animation-delay: 0.6s; }
.balloon::after { content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 30px; background: var(--muted); }
.balloon.popped { transform: scale(1.6); opacity: 0; }
.hang-word { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem; margin: 2.2rem 0 1.2rem; font-size: 2rem; font-weight: 800; text-transform: uppercase; }
.hang-word span { min-width: 1.1em; text-align: center; border-bottom: 3px solid var(--line); }
.hang-word span.shown { color: var(--primary); border-color: var(--primary); animation: pop 0.3s; }
.hang-word span.space { border: 0; min-width: 0.6em; }
.keyboard { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; max-width: 560px; margin: 0 auto 1rem; }
.key { width: 42px; height: 46px; border-radius: 10px; border: 1.5px solid var(--line); border-bottom-width: 3px; background: var(--card); font-weight: 800; text-transform: uppercase; cursor: pointer; }
.key.hit { background: var(--ok-bg); border-color: var(--ok); }
.key.miss { background: var(--bad-bg); border-color: var(--bad); opacity: 0.6; }
.rain-field { position: relative; height: 420px; background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 10%, var(--card)), var(--card)); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; margin: 0.5rem 0 1rem; }
.rain-field::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--bad); opacity: 0.6; }
.drop { position: absolute; top: 0; background: var(--card); border: 2px solid var(--primary); color: var(--text); font-weight: 800; padding: 0.35rem 0.8rem; border-radius: 999px; white-space: nowrap; box-shadow: var(--shadow); }
.drop.pop { animation: popOut 0.3s forwards; border-color: var(--ok); }
.drop.missed { border-color: var(--bad); opacity: 0.4; }
@keyframes popOut { to { transform: scale(1.6); opacity: 0; } }
.game-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.8rem; }
.game-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 1rem; cursor: pointer; }
.game-pick span { font-size: 0.85rem; color: var(--muted); }
.game-pick.active { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent); }
.gp-icon { font-size: 2rem; }
.topic-grid.small { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.6rem; }
.topic-chip { display: flex; align-items: center; gap: 0.5rem; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 0.65rem 0.8rem; cursor: pointer; font-weight: 700; text-align: left; }
.topic-chip span:nth-child(2) { flex: 1; }
.topic-chip:hover { border-color: var(--primary); }
.topic-chip.locked { opacity: 0.6; }

/* ---------- Chat ---------- */
.level-pick { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin: 1rem 0; font-weight: 700; }
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.9rem; }
.scenario { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.scenario:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.s-icon { font-size: 2.2rem; }
.s-title { font-weight: 800; font-size: 1.05rem; }
.s-desc { color: var(--muted); font-size: 0.9rem; }
.chat { max-width: 820px; margin: 0 auto; height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); display: flex; flex-direction: column; padding: 0 16px; }
.chat-head { display: flex; align-items: center; gap: 0.5rem; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chat-title { flex: 1; min-width: 160px; }
.chat-toggles { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.chat-list { flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 0.9rem; }
.msg { display: flex; gap: 0.6rem; align-items: flex-end; max-width: 88%; animation: floatIn 0.3s both; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar { width: 34px; height: 34px; font-size: 0.95rem; flex: none; }
.bubble { background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 0.7rem 0.95rem; box-shadow: var(--shadow); min-width: 0; }
.msg.me .bubble { background: var(--primary); color: #fff; border-color: transparent; border-radius: 18px 18px 6px 18px; }
.bubble .text { font-size: 1.05rem; font-weight: 500; }
.bubble .trans { display: none; color: var(--muted); font-size: 0.9rem; margin-top: 0.3rem; font-style: italic; }
.bubble .trans.open, .show-trans .bubble .trans { display: block; }
.bubble .tip { font-size: 0.88rem; margin-top: 0.4rem; color: var(--muted); }
.msg-actions { display: flex; gap: 0.2rem; align-items: center; margin-top: 0.2rem; }
.msg-actions .icon-btn { width: 30px; height: 30px; }
.corrections { margin-top: 0.5rem; background: rgba(255,255,255,0.15); border-radius: 10px; padding: 0.4rem 0.6rem; }
.corr { padding: 0.2rem 0; }
.corr .muted { color: rgba(255,255,255,0.85); }
.corr s { opacity: 0.8; }
.no-errors { margin-top: 0.3rem; font-size: 0.85rem; opacity: 0.9; }
.chat-sugg { display: flex; gap: 0.4rem; flex-wrap: wrap; padding-bottom: 0.5rem; }
.chat-sugg .chip { font-weight: 500; text-align: left; }
.chat-bar { display: flex; gap: 0.5rem; align-items: center; padding: 10px 0 calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.chat-input { flex: 1; border: 2px solid var(--line); background: var(--card); border-radius: 16px; padding: 0.7rem 0.9rem; resize: none; max-height: 120px; font-size: 1rem; }
.chat-input:focus { outline: none; border-color: var(--primary); }
.send { width: 48px; height: 48px; padding: 0; border-radius: 50%; }
.switch { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; font-weight: 600; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.slider { width: 34px; height: 20px; background: var(--line); border-radius: 999px; position: relative; transition: background 0.2s; }
.slider::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: transform 0.2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::after { transform: translateX(14px); }
.switch input:focus-visible + .slider { outline: 3px solid color-mix(in srgb, var(--primary) 60%, transparent); }

/* ---------- Pronunciation ---------- */
.pair-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.9rem; }
.pair-card { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 0.3rem; transition: transform 0.15s; }
.pair-card:hover { transform: translateY(-3px); }
.pair-sound { font-weight: 800; font-size: 1.15rem; color: var(--primary); }
.pair-ex { font-weight: 700; }
.twister-list { display: flex; flex-direction: column; gap: 0.6rem; }
.twister { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 1rem; }
.tw-text { font-weight: 600; }
.mirror-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.5rem; }
.mirror-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 1rem; }
.mirror-row .mw-text { font-weight: 600; }
.mirror-row audio { display: none; }
.rec-play:not(:disabled) { color: var(--primary); }
@media (max-width: 640px) { .mirror-row { flex-direction: column; align-items: flex-start; } }
.tw-actions { display: flex; align-items: center; gap: 0.3rem; flex: none; }
.tw-result { min-width: 52px; font-weight: 800; text-align: right; }
.tw-result.good { color: var(--ok); }
.tw-result.ok { color: var(--amber); }
.tw-result.bad { color: var(--bad); }
.rule-box { background: color-mix(in srgb, var(--amber) 15%, var(--card)); border: 1px solid color-mix(in srgb, var(--amber) 40%, var(--line)); border-radius: var(--radius-sm); padding: 0.8rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.pairs-body { max-width: 620px; margin: 0 auto; }
.say-box { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1rem; }
.say-row { display: flex; align-items: center; gap: 0.6rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; font-size: 1.3rem; }
.say-row b { min-width: 110px; }
.say-mark { font-size: 0.95rem; }

/* ---------- Profile ---------- */
.profile-head { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1.5rem; }
.profile-head h1 { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.8rem; margin-bottom: 1rem; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; text-align: center; }
.stat-card b { font-size: 1.35rem; }
.stat-card span { font-size: 0.78rem; color: var(--muted); }
.sc-emoji { font-size: 1.5rem; }
.chart { display: flex; gap: 0.4rem; height: 160px; align-items: stretch; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; font-size: 0.7rem; color: var(--muted); }
.bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar { width: 100%; min-height: 3px; background: color-mix(in srgb, var(--primary) 45%, var(--bg-2)); border-radius: 8px 8px 3px 3px; transition: height 0.6s; }
.bar.goal { background: var(--grad); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
.ach { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0.8rem 0.5rem; border-radius: var(--radius-sm); border: 1px dashed var(--line); opacity: 0.45; filter: grayscale(1); }
.ach.got { opacity: 1; filter: none; border-style: solid; background: color-mix(in srgb, var(--amber) 10%, var(--card)); }
.ach-icon { font-size: 1.8rem; }
.ach span { font-size: 0.75rem; color: var(--muted); }
.settings { display: flex; flex-direction: column; gap: 0.7rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 600; font-size: 0.92rem; }
.field input, .field select { border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 0.65rem 0.8rem; font-weight: 500; font-size: 1rem; }
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); }
.check-row { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.92rem; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin-top: 0.15rem; accent-color: var(--primary); flex: none; }
.row-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- Premium ---------- */
.premium-page { max-width: 860px; }
.pm-crown { font-size: 3.2rem; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.5rem 0; }
.plan { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 24px; padding: 1.6rem; box-shadow: var(--shadow); text-align: center; }
.plan.best { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.plan .price { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; }
.plan .price span { font-size: 1rem; color: var(--muted); font-weight: 600; }
.ribbon { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--grad); color: #fff; font-weight: 800; font-size: 0.8rem; padding: 0.25rem 0.9rem; border-radius: 999px; white-space: nowrap; }
.checks { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-direction: column; gap: 0.5rem; }
.checks li { display: flex; gap: 0.6rem; align-items: flex-start; }
.checks li::before { content: '✓'; color: var(--ok); font-weight: 900; }
.checks.big li { font-size: 1.05rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 1rem; }
.checks.big li::before { content: none; }
.premium-modal { text-align: center; }
.pm-price { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.legal { max-width: 780px; }

/* ---------- Modal, toast, misc ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 12, 40, 0.5); display: grid; place-items: center; padding: 16px; z-index: 100; opacity: 0; transition: opacity 0.2s; }
.overlay.show { opacity: 1; }
.modal { position: relative; background: var(--card); border-radius: 24px; padding: 1.8rem; width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg); transform: translateY(16px) scale(0.98); transition: transform 0.2s; }
.overlay.show .modal { transform: none; }
.modal-wide { max-width: 720px; }
.modal-close { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 1.8rem; line-height: 1; color: var(--muted); cursor: pointer; }
.auth-form { display: flex; flex-direction: column; gap: 0.8rem; }
.auth-form h2 { margin: 0; }
.auth-form .reg-only { display: none; }
.auth-form.is-register .reg-only { display: flex; flex-direction: column; gap: 0.8rem; }
.form-error { color: var(--bad); font-weight: 600; min-height: 1.2em; font-size: 0.92rem; }
/* Přihlášení přes Google */
.google-block { display: flex; flex-direction: column; gap: 0.8rem; }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; background: #fff; color: #3c4043; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(60,64,67,0.12); font-weight: 600; }
.btn-google:hover:not(:disabled) { background: #f8f9fb; }
.btn-google .g-icon { display: inline-flex; }
.btn-google .g-icon svg { display: block; }
.or-sep { display: flex; align-items: center; gap: 0.8rem; color: var(--muted); font-size: 0.85rem; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; width: calc(100% - 32px); max-width: 480px; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 0.7rem 1.1rem; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: opacity 0.25s, transform 0.25s; text-align: center; }
.toast.show { opacity: 1; transform: none; }
.toast-error { background: var(--bad); color: #fff; }
.toast-success { background: var(--ok); color: #fff; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; }
.loading-dots { display: inline-flex; gap: 6px; padding: 0.3rem 0; }
.loading-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); animation: dots 1s infinite ease-in-out; }
.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dots { 50% { transform: translateY(-6px); opacity: 0.4; } }

#footer { border-top: 1px solid var(--line); margin-top: 2rem; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 24px 16px; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner nav { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
.footer-inner nav a { color: var(--muted); font-weight: 600; }
.lang-link { display: inline-flex; align-items: center; gap: .45em; }
.flag { display: inline-flex; width: 1.5em; height: 1em; flex: none; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(127, 127, 127, .35); }
.flag svg { width: 100%; height: 100%; display: block; }

/* ---------- Responsive ---------- */
/* Nad tímto bodem se vejdou i textové popisky navigace do horní lišty; pod ním jen ikony */
@media (max-width: 1360px) {
  .main-nav a span:not(.icon) { display: none; }
  .main-nav a { padding: 0.55rem 0.7rem; }
}
@media (max-width: 1000px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .level-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .hero-visual { min-height: 280px; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .level-cards { grid-template-columns: 1fr 1fr; }
  .dash { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .pricing-teaser { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  :root { --header-h: 56px; }
  .main-nav { display: none; }
  .hide-sm { display: none; }
  .pill.xp small { display: none; }
  #tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: var(--card); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); justify-content: space-around; }
  #tabbar a { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 0.66rem; font-weight: 700; color: var(--muted); padding: 4px 2px; border-radius: 10px; flex: 1; min-width: 0; }
  #tabbar a span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  #tabbar a .icon { width: 22px; height: 22px; }
  #tabbar a.active { color: var(--primary); }
  #tabbar a:hover { text-decoration: none; }
  body { padding-bottom: 64px; }
  body.in-lesson { padding-bottom: 0; }
  .options.grid { grid-template-columns: 1fr; }
  .options.grid.two { grid-template-columns: 1fr 1fr; }
  .end-stats { grid-template-columns: 1fr 1fr; }
  .pexeso { grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
  .plans { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .foot-inner .btn-primary { min-width: 0; flex: 1; }
  .feedback { flex-direction: column; align-items: stretch; }
  .feedback .btn-primary { width: 100%; }
  .chat-toggles { width: 100%; justify-content: flex-start; }
  .twister { flex-direction: column; align-items: flex-start; }
  .chat { height: calc(100dvh - var(--header-h)); }
  .feature-grid { grid-template-columns: 1fr; }
  .words { grid-template-columns: 1fr; }
  .topic-head { flex-direction: column; align-items: flex-start; }
  .hero-stats { gap: 1.2rem; }
  .header-inner { gap: 0.5rem; }
}
@media (max-width: 420px) {
  .level-cards { grid-template-columns: 1fr; }
  .pexeso { grid-template-columns: repeat(3, 1fr); }
  .key { width: 32px; height: 42px; }
  .pill { padding: 0.25rem 0.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 420px) {
  .pill.xp { display: none; }
  .lang-switch button { padding: 0.3rem 0.4rem; }
  .lang-switch .lang-code { display: none; }
}
@media (max-width: 900px) {
  .header-inner { gap: 0.5rem; }
  .main-nav { margin-left: 0.25rem; }
  .main-nav a { padding: 0.5rem 0.55rem; }
  .hide-sm, .pill.xp small { display: none; }
  .header-right { gap: 0.35rem; }
}

/* ---------- Aplikace v telefonu ---------- */
.app-banner { display: flex; align-items: center; gap: 0.9rem; margin-top: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; color: var(--text); box-shadow: var(--shadow); }
.app-banner:hover { text-decoration: none; border-color: var(--primary); }
.app-banner img { border-radius: 12px; flex: none; }
.app-banner b { display: block; }
.app-banner span { font-size: 0.88rem; color: var(--muted); }
.install-card { display: flex; align-items: center; gap: 1rem; }
.install-card h3 { margin: 0 0 0.2rem; }
.install-card p { margin: 0; }
.ic-icon img { border-radius: 14px; display: block; }
.phone-qr { display: flex; gap: 1.5rem; align-items: flex-start; }
.qr-box { background: #fff; border-radius: 16px; padding: 10px; flex: none; box-shadow: var(--shadow); }
.qr-box img { display: block; }
.phone-qr h3 { margin-top: 0.4rem; }
.phone-url code, .addr { background: var(--bg-2); padding: 0.25rem 0.5rem; border-radius: 8px; font-size: 0.95rem; word-break: break-all; }
.addr { display: inline-block; margin: 0.2rem 0.3rem 0 0; }
.install-help ol { padding-left: 1.2rem; line-height: 1.9; }
.ios-share { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--bg-2); }

/* Nainstalovaná aplikace: bezpečné okraje (výřez displeje) a žádné „přetahování“ stránky */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
  #header { padding-top: env(safe-area-inset-top); }
  #footer { display: none; }
}
@media (max-width: 720px) {
  .phone-qr { flex-direction: column; align-items: center; text-align: left; }
  .install-card { flex-wrap: wrap; }
  .install-card .btn { width: 100%; }
  /* větší dotykové plochy */
  .option { min-height: 56px; }
  .btn { min-height: 46px; }
  .icon-btn { width: 44px; height: 44px; }
  .q-prompt { font-size: 1.2rem; }
  .lesson-body { padding: 18px 0; }
}
@media (max-width: 720px) {
  .header-right > a.icon-btn { display: none; } /* profil je v dolní liště */
}

/* Rozřazovací test */
.placement-banner { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; margin: 0 0 1.2rem; border-radius: 18px; background: var(--card); border: 1px solid var(--line); color: inherit; }
.placement-banner:hover { text-decoration: none; border-color: var(--primary); }
.placement-banner b, .placement-banner span { display: block; }
.placement-banner .grow > span { color: var(--muted); font-size: .92rem; }
.placement-banner .pb-emoji { font-size: 1.8rem; }
.placement-badge { display: inline-grid; place-items: center; width: 96px; height: 96px; border-radius: 28px; font-size: 2.2rem; font-weight: 900; color: #fff; background: var(--grad); margin: 0 auto 1rem; }
.placement-badge.small { width: 48px; height: 48px; border-radius: 14px; font-size: 1.1rem; margin: 0; flex: none; }
.placement-end .lead { max-width: 520px; margin: 0 auto 0.6rem; }

/* Čtení a poslech */
.read-banner { margin-top: -0.4rem; }
.read-level h2 { margin: 1.6rem 0 0.6rem; }
.read-done { font-size: 0.8rem; font-weight: 800; color: var(--ok); }
.read-bar { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin: 0.4rem 0 1rem; }
.read-play { display: flex; gap: 0.5rem; }
.read-play .btn.active { border-color: var(--primary); color: var(--primary); }
.read-card-text { font-size: 1.12rem; line-height: 1.75; }
.read-text p { margin: 0 0 0.9rem; }
.read-text.dialogue p { margin: 0 0 0.45rem; }
.read-text .who { color: var(--primary); }
.read-sent { cursor: pointer; border-radius: 4px; transition: background 0.15s; }
.read-sent:hover { background: rgba(109, 94, 252, 0.08); }
.read-sent.now { background: rgba(109, 94, 252, 0.2); }
.read-hidden { color: var(--muted); text-align: center; padding: 1.4rem 0.5rem; }
.read-gloss { margin-top: 1rem; }
.read-gloss summary { cursor: pointer; font-weight: 800; }
.read-gloss dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0.8rem 0 0; }
.read-gloss dt { font-weight: 800; }
.read-gloss dd { margin: 0; color: var(--muted); }
.read-q { margin: 0 0 1.4rem; }
.read-q-text { font-weight: 800; font-size: 1.08rem; margin: 0 0 0.6rem; }
.option.selected { border-color: var(--primary); background: rgba(109, 94, 252, 0.08); }
.read-check { text-align: center; margin: 1rem 0; }
.read-result { text-align: center; }
@media (max-width: 560px) { .read-card-text { font-size: 1.04rem; } .read-play { width: 100%; } .read-play .btn { flex: 1; } }

/* Cvičná maturita */
.mat-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.mat-part { display: flex; flex-direction: column; gap: 0.3rem; }
.mat-start { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.mat-start p { margin: 0; }
.mat-history { width: 100%; border-collapse: collapse; }
.mat-history td { padding: 0.45rem 0.4rem; border-bottom: 1px solid var(--line); }
.mat-bar { position: sticky; top: var(--header-h); z-index: 5; display: flex; align-items: center; gap: 1rem; padding: 0.6rem 0.9rem; margin: 0 0 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.mat-bar b { flex: 1; }
.mat-timer { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.mat-timer.low { color: var(--bad); }
.mat-section { margin-bottom: 2rem; }
.mat-item { margin-bottom: 1.2rem; }
.mat-play { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.mat-transcript { border-left: 3px solid var(--line); padding-left: 0.9rem; margin-bottom: 1rem; }
.mat-explain .rule { margin: 0.5rem 0 0; }
.mat-score { text-align: center; margin-bottom: 1.5rem; }
.mat-score.pass { border-color: var(--ok); }
.mat-score.fail { border-color: var(--bad); }
.mat-pct { font-size: 3rem; font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mat-sections { display: grid; gap: 0.5rem; max-width: 460px; margin: 1rem auto; text-align: left; }
.mat-sections > div { display: grid; grid-template-columns: 1fr 120px 48px; align-items: center; gap: 0.6rem; }
@media (max-width: 560px) { .mat-bar { gap: 0.5rem; } .mat-bar .muted { display: none; } .mat-sections > div { grid-template-columns: 1fr 80px 44px; } }

/* Třídy a úkoly */
.classes section { margin-bottom: 2rem; }
.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.inline-form input, .inline-form select { flex: 1; min-width: 160px; padding: 0.6rem 0.8rem; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); font: inherit; }
.inline-form input[type="date"] { flex: 0 0 auto; }
.code-input { text-transform: uppercase; letter-spacing: 0.15em; font-weight: 800; max-width: 200px; }
.class-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: 0.12em; background: var(--bg-2); padding: 0.1rem 0.5rem; border-radius: 8px; }
.class-code.big { font-size: 2rem; display: inline-block; margin-top: 0.2rem; }
.class-invite { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.class-invite p { margin: 0 0 0.3rem; }
.join-url { word-break: break-all; font-size: 0.9rem; }
.invite-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.class-card { margin-bottom: 1rem; }
.class-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.class-head h3 { margin: 0; }
.assign-list { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.5rem; }
.assign-list li { display: grid; grid-template-columns: 1fr auto 120px auto; align-items: center; gap: 0.7rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.assign-list.teacher li { grid-template-columns: 1fr auto auto auto; }
.assign-list .late { color: var(--bad); font-weight: 700; }
.pct-chip { font-weight: 800; font-size: 0.82rem; padding: 0.1rem 0.45rem; border-radius: 8px; white-space: nowrap; }
.pct-chip.hi { background: var(--ok-bg); color: var(--ok); }
.pct-chip.mid { background: #fff4d6; color: #a16207; }
.pct-chip.lo { background: var(--bad-bg); color: var(--bad); }
.table-wrap { overflow-x: auto; }
.class-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.class-table th, .class-table td { padding: 0.5rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.class-table th { color: var(--muted); font-size: 0.8rem; }
.btn.danger { color: var(--bad); }
@media (max-width: 560px) { .assign-list li { grid-template-columns: 1fr auto; } .assign-list li .progress { display: none; } }
@media (max-width: 640px) { .class-invite { flex-direction: column; align-items: stretch; } .class-invite .grow { min-width: 0; } }
@media (max-width: 560px) { .assign-list.teacher li { grid-template-columns: 1fr auto; } }

/* Nápověda „klepni na slovo“ */
.hint-word { cursor: pointer; border-bottom: 2px dotted color-mix(in srgb, var(--primary) 55%, transparent); border-radius: 2px; transition: background 0.12s; }
.hint-word:hover, .hint-word.open { background: rgba(109, 94, 252, 0.14); border-bottom-color: var(--primary); }
.hint-word:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.hint-pop { position: absolute; z-index: 1000; min-width: 140px; max-width: min(320px, calc(100vw - 16px)); background: var(--card); color: var(--text); border: 1.5px solid var(--primary); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 0.55rem 0.8rem; font-size: 0.98rem; animation: hintIn 0.12s ease-out; }
.hint-pop ul { list-style: none; margin: 0; padding: 0; }
.hint-pop li { padding: 0.25rem 0; font-weight: 700; }
.hint-pop li + li { border-top: 1px solid var(--line); }
.hint-form { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.2rem; }
.hint-say { margin-top: 0.35rem; border: 0; background: none; color: var(--primary); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; padding: 0; }
.hint-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.hint-actions .hint-say { flex: 1; text-align: left; }
.hint-actions .star { margin-top: 0.35rem; font-size: 1.1rem; line-height: 1; }
@keyframes hintIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
