/* Lingo Learn (lingo.php, lingo.js). Bright, friendly, chunky buttons. */
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 700 900; font-display: swap; src: url(fonts/bricolage-grotesque-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700 900; font-display: swap; src: url(fonts/inter-latin-700-normal.woff2) format('woff2'); }

:root {
  --bg: #FFF8EC; --paper: #FFFFFF; --ink: #1E2433; --muted: #667085; --line: #EADFCB;
  --green: #22C55E; --green-d: #16A34A; --green-dd: #15803D; --green-soft: #DCFCE7;
  --ok: #22C55E; --ok-d: #16A34A; --ok-dd: #15803D; --ok-soft: #DCFCE7; --card-top: #FDE68A;
  --red: #EF4444; --red-d: #B91C1C; --red-soft: #FEE2E2;
  --gold: #FACC15; --orange: #F97316; --blue: #3B82F6; --purple: #8B5CF6;
  --font-d: 'Bricolage Grotesque', system-ui, sans-serif; --font-b: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.lingo { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--font-b);
  background-image: radial-gradient(circle at 10% 0%, rgba(34, 197, 94, .12), transparent 40%), radial-gradient(circle at 100% 30%, rgba(250, 204, 21, .14), transparent 35%); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } }
button { font: inherit; color: inherit; }
a { color: var(--green-dd); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lg-app { max-width: 1120px; margin: 0 auto; padding: 0 16px 60px; }

/* Top bar */
.lg-top { display: flex; align-items: center; gap: 12px; padding: 14px 0; flex-wrap: wrap; }
.lg-brand { display: inline-flex; width: 36px; height: 36px; }
.lg-brand svg, .lg-brand img { width: 100%; height: 100%; }
.lg-title { display: inline-flex; align-items: center; gap: 8px; font: 900 22px var(--font-d); color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.lg-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--green); color: #fff; font: 900 17px var(--font-d); box-shadow: 0 3px 0 var(--green-dd); transform: rotate(-6deg); }
.lg-chips { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.lg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--paper); border: 2px solid var(--line); font-weight: 800; font-size: 15px; white-space: nowrap; }
.lg-chip svg { width: 20px; height: 20px; }
.lg-chip.fire svg { fill: #D1D5DB; }
.lg-chip.fire.lit svg { fill: var(--orange); filter: drop-shadow(0 0 4px rgba(249, 115, 22, .5)); }
.lg-chip.fire.lit { color: var(--orange); border-color: #FED7AA; }
.lg-chip-u { font-size: 12px; color: var(--muted); font-weight: 700; }
.lg-chip.flag { cursor: pointer; }
.lg-chip.flag img { width: 24px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); }
.lg-chip.flag:hover { border-color: var(--green); }
.lg-speak { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 700; }
.lang-switch { display: inline-flex; background: var(--paper); border: 2px solid var(--line); border-radius: 10px; overflow: hidden; }
.lang-switch a { padding: 5px 9px; font-size: 13px; font-weight: 800; color: var(--muted); text-decoration: none; }
.lang-switch a[aria-current] { background: var(--ink); color: #fff; }

.lg-ring { position: relative; display: inline-block; flex: none; }
.lg-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lg-ring circle { fill: none; stroke-width: 4; }
.lg-ring .bg { stroke: #EEE6D6; }
.lg-ring .fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dasharray .8s ease; }

/* Cards and buttons */
.lg-main { position: relative; }
.lg-wait { text-align: center; color: var(--muted); padding: 60px 0; }
.lg-card { background: var(--paper); border-radius: 28px; padding: 32px; box-shadow: 0 2px 0 var(--line), 0 18px 50px rgba(120, 90, 40, .1); margin-top: 16px; animation: lg-up .45s cubic-bezier(.2, 1.2, .4, 1) both; }
.lg-h1 { font: 900 clamp(26px, 5vw, 36px)/1.15 var(--font-d); margin: 0 0 10px; letter-spacing: -.015em; }
.lg-lead { font-size: 19px; color: var(--muted); margin: 0 0 16px; }
.lg-kicker { margin: 0 0 6px; font-weight: 800; color: var(--green-dd); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.lg-sub { margin: 0; color: var(--muted); font-weight: 600; }
.lg-note { color: var(--muted); font-size: 14px; margin: 18px 0 0; }
.center { text-align: center; justify-content: center; }
.lg-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.lg-input { flex: 1 1 220px; font: inherit; font-size: 18px; padding: 13px 16px; border-radius: 14px; border: 2px solid var(--line); background: #FFFDF8; min-width: 0; }
.lg-input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 4px var(--green-soft); }
.lg-input.code { text-transform: uppercase; letter-spacing: .1em; flex: 0 1 180px; }
.lg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 14px; border: 2px solid var(--line); background: var(--paper); font-weight: 800; font-size: 16px; cursor: pointer; text-transform: uppercase; letter-spacing: .04em; box-shadow: 0 4px 0 var(--line); transition: transform .08s, box-shadow .08s, filter .15s; }
.lg-btn:hover { filter: brightness(1.04); }
.lg-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.lg-btn:disabled { opacity: .55; cursor: default; }
.lg-btn.primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 4px 0 var(--green-dd); }
.lg-btn.primary:active { box-shadow: 0 1px 0 var(--green-dd); }
.lg-btn.danger { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-d); }
.lg-btn.ghost { background: transparent; }
.lg-btn.small { padding: 7px 14px; font-size: 13px; }
.lg-btn.big { padding: 15px 28px; font-size: 17px; min-width: 200px; }
.lg-link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 10px 0; font-weight: 600; }
.lg-claim { margin-top: 14px; color: var(--muted); }
.lg-claim summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.lg-claim .lg-row { margin-top: 8px; }

/* Welcome */
.lg-hello { text-align: center; padding-top: 18px; }
.lg-hello .lg-row { justify-content: center; max-width: 520px; margin: 0 auto; }
.lg-hero-art { position: relative; height: 150px; margin: 0 auto 8px; max-width: 520px; }
.lg-bubble { position: absolute; padding: 8px 16px; border-radius: 18px; font: 900 20px var(--font-d); color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .15); animation: lg-float 4s ease-in-out infinite, lg-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.lg-bubble::after { content: ''; position: absolute; bottom: -7px; left: 22px; border: 8px solid transparent; border-top-color: inherit; border-bottom: 0; }
.lg-bubble.b1 { left: 4%; top: 18px; background: var(--orange); border-color: var(--orange); animation-delay: 0s, .05s; }
.lg-bubble.b2 { left: 30%; top: 0; background: var(--blue); border-color: var(--blue); animation-delay: .6s, .15s; }
.lg-bubble.b3 { right: 8%; top: 16px; background: var(--green); border-color: var(--green); animation-delay: 1.2s, .25s; }
.lg-bubble.b4 { left: 14%; top: 86px; background: var(--purple); border-color: var(--purple); animation-delay: 1.8s, .35s; }
.lg-bubble.b5 { left: 46%; top: 70px; background: #EC4899; border-color: #EC4899; animation-delay: 2.4s, .45s; }
.lg-bubble.b6 { right: 2%; top: 92px; background: #0EA5E9; border-color: #0EA5E9; animation-delay: 3s, .55s; }

/* Pick a language */
.lg-langs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 18px; }
.lg-lang-card { display: grid; justify-items: center; gap: 4px; padding: 20px 12px 16px; border-radius: 20px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; box-shadow: 0 4px 0 var(--line); transition: transform .12s, border-color .12s, box-shadow .12s; animation: lg-up .45s cubic-bezier(.2, 1.3, .4, 1) both; animation-delay: calc(var(--i) * 50ms); }
.lg-lang-card img { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); margin-bottom: 6px; }
.lg-lang-card b { font: 900 20px var(--font-d); }
.lg-lang-card span { color: var(--muted); font-size: 14px; }
.lg-lang-card:hover { border-color: var(--green); transform: translateY(-3px); box-shadow: 0 7px 0 var(--green-soft); }
.lg-lang-card.on { border-color: var(--green); background: #F0FDF4; }

/* Course header and review */
.lg-course { background: var(--paper); border-radius: 28px; padding: 22px; margin-top: 16px; box-shadow: 0 2px 0 var(--line), 0 18px 50px rgba(120, 90, 40, .08); }
.lg-course-h { display: flex; align-items: center; gap: 16px; }
.lg-course-h > div { flex: 1; min-width: 0; }
.lg-course-h .lg-h1 { margin: 0; font-size: clamp(22px, 4.6vw, 30px); }
.lg-course-flag { width: 66px; height: 44px; object-fit: cover; border-radius: 10px; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--line); }
.lg-review { margin-top: 16px; width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; border: 2px solid #BFDBFE; background: #EFF6FF; cursor: pointer; text-align: left; box-shadow: 0 4px 0 #BFDBFE; }
.lg-review:active { transform: translateY(3px); box-shadow: 0 1px 0 #BFDBFE; }
.lg-review-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--blue); flex: none; }
.lg-review-ico svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lg-review-t { display: grid; flex: 1; }
.lg-review-t b { font-size: 17px; }
.lg-review-t span { font-size: 14px; color: var(--muted); }
/* Resume lesson: the same card as the review button, in the theme's main color. */
.lg-resume { border-color: var(--green); box-shadow: 0 4px 0 var(--green); background: #F0FDF4; }
.lg-resume:active { box-shadow: 0 1px 0 var(--green); }
.lg-resume .lg-review-ico { background: var(--green); }
.lg-resume .lg-review-ico svg { fill: #fff; stroke: none; }
.lg-badge { background: var(--red); color: #fff; font-weight: 900; border-radius: 999px; padding: 2px 10px; font-size: 14px; }

/* The topic path */
.lg-path { list-style: none; margin: 28px 0 0; padding: 0; display: grid; justify-items: center; gap: 22px; }
.lg-node { display: grid; justify-items: center; gap: 4px; transform: translateX(calc(var(--x) * min(70px, 13vw))); position: relative; animation: lg-up .5s cubic-bezier(.2, 1.3, .4, 1) both; animation-delay: calc(min(var(--i), 10) * 40ms); }
.lg-node-b { position: relative; width: 96px; height: 96px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 50%; }
.lg-node-b .lg-ring { position: absolute; inset: 0; width: 96px !important; height: 96px !important; }
.lg-node-b .lg-ring circle { stroke-width: 3.2; }
.lg-node-e { position: absolute; inset: 11px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; background: #E5E7EB; box-shadow: 0 6px 0 #C7CBD1; transition: transform .1s, box-shadow .1s; }
.lg-node.going .lg-node-e, .lg-node.next .lg-node-e { background: var(--green); box-shadow: 0 6px 0 var(--green-dd); }
.lg-node.done .lg-node-e { background: #FDE68A; box-shadow: 0 6px 0 #D97706; }
.lg-node.gold .lg-node-e { background: linear-gradient(135deg, #FDE047, #F59E0B); box-shadow: 0 6px 0 #B45309; }
.lg-node-b:hover .lg-node-e { transform: translateY(-2px); }
.lg-node-b:active .lg-node-e { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0, 0, 0, .2); }
.lg-node-b:disabled { opacity: .6; }
.lg-node.next .lg-node-e { animation: lg-bounce 2.2s ease-in-out infinite; }
.lg-crown { position: absolute; top: -10px; right: -4px; font-size: 26px; transform: rotate(14deg); }
.lg-node-tag { position: absolute; top: -34px; background: var(--paper); border: 2px solid var(--green); color: var(--green-dd); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; padding: 4px 12px; border-radius: 12px; white-space: nowrap; animation: lg-float 2.4s ease-in-out infinite; }
.lg-node-tag::after { content: ''; position: absolute; left: calc(50% - 7px); bottom: -8px; border: 7px solid transparent; border-top-color: var(--green); border-bottom: 0; }
.lg-node-n { font-weight: 800; font-size: 15px; text-align: center; max-width: 170px; line-height: 1.25; margin-top: 4px; }
.lg-node-p { font-size: 13px; color: var(--muted); font-weight: 700; }
.lg-node.next { margin-top: 18px; }

/* A lesson */
.lg-lesson { min-height: calc(100vh - 90px); display: flex; flex-direction: column; padding-bottom: 20px; }
.lg-lesson.has-sheet { padding-bottom: 360px; }
.lg-ltop { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.lg-x { width: 44px; height: 44px; border-radius: 12px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.lg-x:hover { background: #F3EBDD; color: var(--ink); }
.lg-x svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.lg-bar { flex: 1; height: 18px; border-radius: 999px; background: #EEE6D6; overflow: hidden; }
.lg-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(180deg, #4ADE80, var(--green)); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .08), inset 0 4px 0 rgba(255, 255, 255, .35); transition: width .5s cubic-bezier(.2, 1.2, .4, 1); min-width: 18px; }
.lg-combo { min-width: 44px; font: 900 18px var(--font-d); color: var(--orange); text-align: right; }
.lg-combo.bump { animation: lg-pop .5s cubic-bezier(.2, 1.8, .4, 1); }
.lg-qbody { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4vh 0 2vh; }
.lg-again { margin: 0 0 8px; color: var(--orange); font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.lg-emoji { font-size: clamp(64px, 16vw, 96px); line-height: 1; width: 1.6em; height: 1.6em; display: grid; place-items: center; border-radius: 50%; background: var(--paper); box-shadow: 0 6px 0 var(--line), 0 16px 40px rgba(120, 90, 40, .12); margin-bottom: 22px; animation: lg-pop .55s cubic-bezier(.2, 1.6, .4, 1) both; }
.lg-prompt { font: 800 clamp(24px, 5.6vw, 36px)/1.25 var(--font-b); margin: 0; max-width: 680px; animation: lg-up .4s ease-out .1s both; }
.lg-word { background: none; color: var(--green-dd); font-family: var(--font-d); font-weight: 900; white-space: nowrap; padding: 0 2px; box-shadow: inset 0 -.32em 0 #BBF7D0; }
.lg-hint { margin: 6px 0 0; color: var(--muted); font-weight: 700; }
.lg-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; max-width: 680px; margin-top: 7vh; }
.lg-opt { position: relative; display: flex; align-items: center; gap: 14px; text-align: left; padding: 18px 18px; min-height: 72px; border-radius: 18px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; box-shadow: 0 5px 0 var(--line); font-weight: 800; font-size: clamp(19px, 4.6vw, 23px); transition: transform .08s, box-shadow .08s, border-color .12s, background .12s; animation: lg-up .4s cubic-bezier(.2, 1.3, .4, 1) both; animation-delay: calc(var(--i) * 60ms + 150ms); }
.lg-opt:hover:not(:disabled) { border-color: #93C5FD; background: #F8FBFF; }
.lg-opt:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.lg-opt:disabled { cursor: default; }
.lg-key { flex: none; width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 14px; color: var(--muted); }
.lg-opt-t { overflow-wrap: anywhere; }
.lg-opt.picked { border-color: var(--blue); background: #EFF6FF; box-shadow: 0 5px 0 #BFDBFE; }
.lg-opt.right { border-color: var(--ok); background: var(--ok-soft); box-shadow: 0 5px 0 #86EFAC; color: var(--ok-dd); animation: lg-pop .45s cubic-bezier(.2, 1.6, .4, 1); }
.lg-opt.right .lg-key { border-color: var(--ok); color: var(--ok-dd); }
.lg-opt.wrong { border-color: var(--red); background: var(--red-soft); box-shadow: 0 5px 0 #FCA5A5; color: var(--red-d); animation: lg-shake .45s ease; }
.lg-opts:has(.right) .lg-opt:not(.right):not(.wrong) { opacity: .5; }

/* The tip sheet after an answer */
.lg-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 20px max(16px, calc((100vw - 760px) / 2)) calc(20px + env(safe-area-inset-bottom)); border-top: 3px solid; transform: translateY(105%); transition: transform .38s cubic-bezier(.2, 1.1, .3, 1); max-height: 78vh; overflow: auto; }
.lg-sheet.in { transform: none; }
.lg-sheet.ok { background: #E9FBEF; border-color: #86EFAC; }
.lg-sheet.no { background: #FFEDED; border-color: #FCA5A5; }
.lg-sheet-h { display: flex; align-items: center; gap: 14px; }
.lg-sheet-h > div { flex: 1; display: grid; }
.lg-sheet-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #fff; flex: none; }
.lg-sheet-ico svg { width: 28px; height: 28px; fill: none; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.lg-sheet.ok .lg-sheet-ico svg { stroke: var(--ok-d); }
.lg-sheet.no .lg-sheet-ico svg { stroke: var(--red); }
.lg-sheet-t { font: 900 26px var(--font-d); }
.lg-sheet.ok .lg-sheet-t { color: var(--ok-dd); }
.lg-sheet.no .lg-sheet-t { color: var(--red-d); }
.lg-sheet-ans { font-weight: 800; color: var(--red-d); }
.lg-sheet-combo { font-weight: 800; color: var(--orange); }
.lg-sheet-xp { font: 900 18px var(--font-d); color: #CA8A04; background: #FEF9C3; padding: 4px 12px; border-radius: 999px; animation: lg-pop .5s cubic-bezier(.2, 1.8, .4, 1) .2s both; }
.lg-tip { display: flex; gap: 14px; margin: 16px 0; padding: 16px 18px; background: #fff; border-radius: 18px; box-shadow: 0 3px 0 rgba(0, 0, 0, .06); animation: lg-up .45s ease-out .15s both; }
.lg-tip-bulb { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #FEF9C3; }
.lg-tip-bulb svg { width: 28px; height: 28px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.lg-tip-bulb .glass { fill: var(--gold); stroke: #CA8A04; stroke-width: 1.1; animation: lg-bulb 1s steps(1) .3s both; }
.lg-tip-bulb .base { stroke: #9CA3AF; stroke-width: 1.8; }
.lg-tip-b { min-width: 0; flex: 1; }
.lg-tip-word { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lg-tip-word b { font: 900 clamp(24px, 6vw, 32px)/1.1 var(--font-d); }
.lg-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.lg-tag { font-size: 13px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: #F3F4F6; color: #374151; }
.lg-tag.pos { background: #EDE9FE; color: #6D28D9; }
.lg-tag.g-m { background: #DBEAFE; color: #1D4ED8; }
.lg-tag.g-f { background: #FCE7F3; color: #BE185D; }
.lg-tag.g-n { background: #FEF3C7; color: #92400E; }
.lg-ex { margin-top: 12px; border-left: 4px solid #BBF7D0; padding-left: 12px; }
.lg-ex-t { margin: 0; font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lg-ex-b { margin: 2px 0 0; color: var(--muted); font-size: 16px; }
.lg-alt { margin: 10px 0 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.lg-say { width: 38px; height: 38px; border-radius: 12px; border: 2px solid #BFDBFE; background: #EFF6FF; display: inline-grid; place-items: center; cursor: pointer; flex: none; box-shadow: 0 3px 0 #BFDBFE; }
.lg-say svg { width: 22px; height: 22px; fill: var(--blue); }
.lg-say svg .w { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; }
.lg-say.pop svg .w { animation: lg-wave .6s ease; }
.lg-sheet .lg-btn.big { width: 100%; }

/* End of lesson */
.lg-done { text-align: center; }
.lg-done-burst { font-size: 84px; line-height: 1; animation: lg-pop .7s cubic-bezier(.2, 1.8, .4, 1) both; margin-bottom: 8px; }
.lg-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.lg-stat { border-radius: 18px; border: 2px solid; padding: 0 0 12px; overflow: hidden; animation: lg-up .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.lg-stat:nth-child(2) { animation-delay: .1s; } .lg-stat:nth-child(3) { animation-delay: .2s; }
.lg-stat-l { display: block; padding: 6px 4px; color: #fff; font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.lg-stat-v { display: block; font: 900 32px var(--font-d); margin-top: 8px; }
.lg-stat.xp { border-color: var(--gold); } .lg-stat.xp .lg-stat-l { background: var(--gold); color: #713F12; } .lg-stat.xp .lg-stat-v { color: #CA8A04; }
.lg-stat.acc { border-color: var(--green); } .lg-stat.acc .lg-stat-l { background: var(--green); } .lg-stat.acc .lg-stat-v { color: var(--green-dd); }
.lg-stat.fire { border-color: var(--orange); } .lg-stat.fire .lg-stat-l { background: var(--orange); } .lg-stat.fire .lg-stat-v { color: var(--orange); }
.lg-goal { display: inline-flex; align-items: center; gap: 14px; text-align: left; padding: 12px 20px; border-radius: 18px; background: #FFFBEB; border: 2px solid #FDE68A; }
.lg-goal > div { display: grid; }
.lg-goal span { color: var(--muted); font-size: 14px; font-weight: 600; }
.lg-streak-note { font-weight: 800; color: var(--orange); margin: 16px 0 0; }
.lg-done .lg-sub { margin: 10px 0 22px; }
.lg-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.lg-confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: lg-fall linear both; }

/* Quit and toasts */
.lg-modal { position: fixed; inset: 0; z-index: 60; background: rgba(30, 36, 51, .45); display: grid; place-items: center; padding: 16px; animation: lg-fade .2s ease both; }
.lg-modal-box { background: #fff; border-radius: 22px; padding: 24px; max-width: 420px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); animation: lg-pop .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.lg-modal-box p { margin: 0 0 18px; font-weight: 700; font-size: 18px; }
.lg-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 700; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: lg-up .3s ease both; transition: opacity .4s; }
.lg-toast.bad { background: var(--red-d); }
.lg-toast.out { opacity: 0; }

@keyframes lg-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; } }
.lg-node { animation-name: lg-node-in; }
@keyframes lg-node-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lg-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes lg-fade { from { opacity: 0; } }
@keyframes lg-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes lg-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes lg-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes lg-bulb { 0% { fill: #D1D5DB; } 25% { fill: var(--gold); } 45% { fill: #D1D5DB; } 60%, 100% { fill: var(--gold); } }
@keyframes lg-wave { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes lg-fall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), 105vh) rotate(var(--r)); opacity: .9; } }

@media (max-width: 600px) {
  .lg-card { padding: 22px 18px; border-radius: 22px; }
  .lg-speak > span { display: none; }
  .lg-title { font-size: 19px; }
  .lg-chips { order: 3; width: 100%; margin-left: 0; }
  .lg-opts { grid-template-columns: 1fr; gap: 10px; margin-top: 4vh; }
  .lg-opt { min-height: 60px; padding: 14px; }
  .lg-stats { gap: 8px; }
  .lg-stat-v { font-size: 26px; }
  .lg-stat-l { font-size: 11px; }
  .lg-btn.big { min-width: 0; width: 100%; }
  .lg-langs { grid-template-columns: 1fr 1fr; }
  .lg-course-h { flex-wrap: wrap; }
}

/* Reverse questions: the word in the language being learned, big, with a listen button */
.lg-revword { display: inline-flex; align-items: center; gap: 14px; padding: 18px 28px; margin-bottom: 22px; border-radius: 24px; background: var(--paper); box-shadow: 0 6px 0 var(--line), 0 16px 40px rgba(120, 90, 40, .12); animation: lg-pop .55s cubic-bezier(.2, 1.6, .4, 1) both; }
.lg-revword b { font: 900 clamp(30px, 8vw, 48px)/1.1 var(--font-d); color: var(--blue); }
.lg-revword .lg-say { width: 46px; height: 46px; }

/* ---------- Topics in rows, one row per unit ---------- */
.lg-unit { margin-top: 26px; animation: lg-up .45s ease-out both; }
.lg-unit-h { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 12px; margin-bottom: 12px; }
.lg-unit-n { grid-row: span 2; display: grid; place-items: center; min-width: 64px; height: 44px; padding: 0 10px; border-radius: 14px; background: var(--green); color: #fff; font: 900 14px var(--font-d); text-transform: uppercase; letter-spacing: .05em; box-shadow: 0 3px 0 var(--green-dd); }
.lg-unit-t { margin: 0; font: 900 clamp(19px, 3.6vw, 24px)/1.15 var(--font-d); }
.lg-unit-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; max-width: 260px; }
.lg-unit-bar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.lg-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .lg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .lg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 480px) { .lg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lg-topic { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; padding: 14px 14px 12px; min-height: 150px; border-radius: 18px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; box-shadow: 0 4px 0 var(--line); color: var(--ink); transition: transform .12s, border-color .12s, box-shadow .12s; animation: lg-up .4s cubic-bezier(.2, 1.2, .4, 1) both; animation-delay: calc(min(var(--i), 24) * 25ms); }
.lg-topic:hover { transform: translateY(-3px); border-color: var(--green); box-shadow: 0 7px 0 var(--green-soft); }
.lg-topic:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.lg-topic:disabled { opacity: .6; }
.lg-topic-e { font-size: 34px; line-height: 1; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: var(--bg); }
.lg-topic.going .lg-topic-e { background: var(--green-soft); }
.lg-topic.gold { border-color: var(--gold); background: linear-gradient(160deg, var(--paper), color-mix(in srgb, var(--gold) 18%, var(--paper))); }
.lg-topic.next { border-color: var(--green); box-shadow: 0 4px 0 var(--green-dd), 0 0 0 4px var(--green-soft); }
.lg-topic-n { font-size: 15px; line-height: 1.25; flex: 1; }
.lg-topic-bar { width: 100%; height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.lg-topic-bar i { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.lg-topic-f { display: flex; justify-content: space-between; align-items: center; width: 100%; font-size: 12px; font-weight: 800; color: var(--muted); }
.lg-stars i { font-style: normal; color: var(--line); font-size: 14px; margin-left: 1px; }
.lg-stars i.on { color: var(--gold); text-shadow: 0 0 6px color-mix(in srgb, var(--gold) 60%, transparent); }
.lg-topic-tag { position: absolute; top: -11px; right: 10px; background: var(--green); color: #fff; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: 8px; box-shadow: 0 2px 0 var(--green-dd); }

/* ---------- Fill in the blank ---------- */
.lg-fill-k { margin: 0 0 10px; font-weight: 900; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--green-dd); }
.lg-fill { font: 800 clamp(24px, 5.4vw, 34px)/1.45 var(--font-b); margin: 0; max-width: 720px; animation: lg-up .4s ease-out .1s both; }
.lg-gap { display: inline-block; min-width: 4.5em; border-bottom: 4px solid var(--green); margin: 0 4px; line-height: 1.1; color: var(--green-dd); transition: color .2s; }
.lg-gap.filled { min-width: 0; padding: 0 6px; border-radius: 8px; background: var(--ok-soft); border-bottom-color: var(--ok); color: var(--ok-dd); animation: lg-pop .45s cubic-bezier(.2, 1.6, .4, 1); }
.lg-fill-hint { margin: 12px 0 0; color: var(--muted); font-weight: 600; font-size: 17px; font-style: italic; }

/* ---------- Theme picker ---------- */
.lg-themes { position: relative; }
.lg-theme-b { width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); display: grid; place-items: center; cursor: pointer; }
.lg-theme-b svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lg-theme-pop { position: absolute; right: 0; top: 48px; z-index: 40; width: 260px; padding: 12px; border-radius: 18px; background: var(--paper); border: 2px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .18); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; animation: lg-pop .25s cubic-bezier(.2, 1.4, .4, 1) both; }
.lg-theme-pop[hidden] { display: none; }
.lg-theme-pop p { grid-column: 1 / -1; margin: 0 0 2px; font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lg-theme-o { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; font-weight: 800; font-size: 14px; }
.lg-theme-o[aria-pressed="true"] { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.lg-theme-sw { width: 26px; height: 26px; border-radius: 8px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.sw-sunrise { background: linear-gradient(135deg, #FFF8EC 50%, #22C55E 50%); }
.sw-ocean { background: linear-gradient(135deg, #EEF7FF 50%, #0EA5E9 50%); }
.sw-forest { background: linear-gradient(135deg, #F1F5EE 50%, #4D7C0F 50%); }
.sw-berry { background: linear-gradient(135deg, #FDF2F8 50%, #C026D3 50%); }
.sw-citrus { background: linear-gradient(135deg, #FFFBEB 50%, #F97316 50%); }
.sw-night { background: linear-gradient(135deg, #111827 50%, #A3E635 50%); }

/* ---------- Themes ---------- */
body.lingo[data-theme="ocean"] { --bg: #EEF7FF; --line: #CFE3F5; --green: #0EA5E9; --green-d: #0284C7; --green-dd: #0369A1; --green-soft: #E0F2FE; --gold: #FBBF24;
  background-image: radial-gradient(circle at 10% 0%, rgba(14, 165, 233, .14), transparent 40%), radial-gradient(circle at 100% 30%, rgba(45, 212, 191, .16), transparent 35%); }
body.lingo[data-theme="forest"] { --bg: #F1F5EE; --line: #D7E2CF; --green: #4D7C0F; --green-d: #3F6212; --green-dd: #365314; --green-soft: #ECFCCB; --gold: #EAB308;
  background-image: radial-gradient(circle at 10% 0%, rgba(77, 124, 15, .14), transparent 40%), radial-gradient(circle at 100% 30%, rgba(180, 83, 9, .1), transparent 35%); }
body.lingo[data-theme="berry"] { --bg: #FDF2F8; --line: #F5D0E6; --green: #C026D3; --green-d: #A21CAF; --green-dd: #86198F; --green-soft: #FAE8FF; --gold: #F59E0B;
  background-image: radial-gradient(circle at 10% 0%, rgba(192, 38, 211, .12), transparent 40%), radial-gradient(circle at 100% 30%, rgba(244, 63, 94, .12), transparent 35%); }
body.lingo[data-theme="citrus"] { --bg: #FFFBEB; --line: #F5E2B8; --green: #F97316; --green-d: #EA580C; --green-dd: #C2410C; --green-soft: #FFEDD5; --gold: #EAB308;
  background-image: radial-gradient(circle at 10% 0%, rgba(249, 115, 22, .14), transparent 40%), radial-gradient(circle at 100% 30%, rgba(250, 204, 21, .2), transparent 35%); }
body.lingo[data-theme="night"] { --bg: #0F1420; --paper: #182032; --ink: #EEF2FF; --muted: #9AA7C2; --line: #2A3550; --green: #A3E635; --green-d: #84CC16; --green-dd: #4D7C0F; --green-soft: #26331A; --gold: #FACC15;
  --ok-soft: #123222; --red-soft: #3A1620; color-scheme: dark;
  background-image: radial-gradient(circle at 10% 0%, rgba(163, 230, 53, .1), transparent 40%), radial-gradient(circle at 100% 30%, rgba(99, 102, 241, .16), transparent 35%); }
body.lingo[data-theme="night"] .lg-btn.primary, body.lingo[data-theme="night"] .lg-unit-n, body.lingo[data-theme="night"] .lg-topic-tag, body.lingo[data-theme="night"] .lg-logo { color: #10200A; }
body.lingo[data-theme="night"] .lg-input { background: #121a2a; color: var(--ink); }
body.lingo[data-theme="night"] .lg-sheet.ok { background: #102A1C; border-color: #166534; }
body.lingo[data-theme="night"] .lg-sheet.no { background: #2E1219; border-color: #9F1239; }
body.lingo[data-theme="night"] .lg-tip, body.lingo[data-theme="night"] .lg-modal-box, body.lingo[data-theme="night"] .lg-sheet-ico, body.lingo[data-theme="night"] .lg-lang-card.on { background: var(--paper); }
body.lingo[data-theme="night"] .lg-tag { background: #24304a; color: #CBD5E1; }
body.lingo[data-theme="night"] .lg-say { background: #1E2A44; border-color: #334155; box-shadow: 0 3px 0 #334155; }
body.lingo[data-theme="night"] .lg-review { background: #172540; border-color: #1E3A8A; box-shadow: 0 4px 0 #1E3A8A; }
body.lingo[data-theme="night"] .lg-resume { background: #13261b; border-color: var(--green-dd); box-shadow: 0 4px 0 var(--green-dd); }
body.lingo[data-theme="night"] .lg-goal { background: #2A2410; border-color: #713F12; }
body.lingo[data-theme="night"] .lg-opt.picked { background: #172540; }
body.lingo[data-theme="night"] .lg-sheet-xp { background: #3A3210; }
body.lingo[data-theme="night"] .lang-switch a[aria-current] { background: var(--green); color: #10200A; }
body.lingo[data-theme="night"] .lg-ring .bg { stroke: #2A3550; }
body.lingo[data-theme="night"] .lg-word { box-shadow: inset 0 -.32em 0 #2E4A16; }
.lg-course, .lg-card { max-width: 880px; margin-left: auto; margin-right: auto; }
.lg-lesson { max-width: 880px; margin: 0 auto; }
body.lingo[data-theme="night"] .lg-bar { background: #26304a; }
body.lingo[data-theme="night"] .lg-x:hover { background: #26304a; color: var(--ink); }
body.lingo[data-theme="night"] .lg-topic.gold { background: linear-gradient(160deg, var(--paper), #3a3214); }

/* ---------- Learn: unit course slideshow ---------- */
.lg-unit-h { grid-template-columns: auto auto 1fr; }
.lg-unit-n { grid-row: span 2; }
.lg-learn { grid-row: span 2; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--green); background: var(--paper); color: var(--green-dd); font: 900 14px var(--font-d); text-transform: uppercase; letter-spacing: .05em; cursor: pointer; box-shadow: 0 3px 0 var(--green-soft); transition: transform .1s, background .15s; }
.lg-learn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.lg-learn:hover { background: var(--green-soft); }
.lg-learn:active { transform: translateY(2px); box-shadow: none; }
.lg-learn:disabled { opacity: .6; }
body.lingo[data-theme="night"] .lg-learn { color: var(--green); }

.lg-cv { max-width: 880px; margin: 0 auto; min-height: calc(100vh - 90px); display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; }
.lg-cv-top { display: flex; align-items: center; gap: 12px; padding-top: 8px; }
.lg-cv-title { display: grid; flex: 1; min-width: 0; }
.lg-cv-title b { font: 900 22px var(--font-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-cv-kick { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--green-dd); }
.lg-cv-sel { font: inherit; font-weight: 700; font-size: 15px; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); max-width: 46%; }
.lg-cv-snd { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); display: grid; place-items: center; cursor: pointer; flex: none; }
.lg-cv-snd svg { width: 22px; height: 22px; fill: var(--muted); }
.lg-cv-snd svg .w { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; opacity: .35; }
.lg-cv-snd.on { border-color: var(--blue); background: #EFF6FF; }
.lg-cv-snd.on svg { fill: var(--blue); }
.lg-cv-snd.on svg .w { stroke: var(--blue); opacity: 1; }
body.lingo[data-theme="night"] .lg-cv-snd.on { background: #172540; }
.lg-cv-bar { height: 10px; }
.lg-cv-stage { flex: 1; display: grid; align-items: center; padding: 10px 0; overflow: hidden; }
.lg-slide { background: var(--paper); border-radius: 28px; padding: 30px 28px; text-align: center; box-shadow: 0 2px 0 var(--line), 0 18px 50px rgba(120, 90, 40, .1); animation: lg-fade .3s ease both; }
.lg-slide.from-r { animation: lg-slide-r .35s cubic-bezier(.2, 1, .3, 1) both; }
.lg-slide.from-l { animation: lg-slide-l .35s cubic-bezier(.2, 1, .3, 1) both; }
@keyframes lg-slide-r { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes lg-slide-l { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
.lg-slide-big { font-size: 64px; line-height: 1; margin-bottom: 10px; }
.lg-slide .lg-lead { max-width: 560px; margin: 8px auto 18px; }
.lg-slide-tip { font-size: clamp(18px, 3.6vw, 22px); line-height: 1.55; font-weight: 600; max-width: 620px; margin: 6px auto 0; }
.lg-cv-chs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; text-align: left; }
.lg-cv-ch { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; text-align: left; box-shadow: 0 3px 0 var(--line); }
.lg-cv-ch:hover { border-color: var(--green); }
.lg-cv-ch-e { grid-row: span 2; font-size: 28px; }
.lg-cv-ch b { font-size: 15px; }
.lg-cv-ch span:last-child { font-size: 12px; color: var(--muted); font-weight: 700; }
.lg-cv-peek { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-size: 30px; }
.lg-cv-peek span { animation: lg-pop .4s cubic-bezier(.2, 1.6, .4, 1) both; }
.lg-cv-peek span:nth-child(2n) { animation-delay: .06s; } .lg-cv-peek span:nth-child(3n) { animation-delay: .12s; }
.lg-slide-e { font-size: clamp(72px, 18vw, 110px); line-height: 1; margin-bottom: 8px; animation: lg-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.lg-slide-word { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.lg-slide-word b { font: 900 clamp(34px, 9vw, 56px)/1.1 var(--font-d); color: var(--green-dd); }
body.lingo[data-theme="night"] .lg-slide-word b { color: var(--green); }
.lg-slide-word .lg-say { width: 48px; height: 48px; }
.lg-slide-means { margin: 6px 0 10px; font-size: 22px; font-weight: 700; color: var(--muted); }
.lg-tags.center { justify-content: center; }
.lg-slide-ex { text-align: left; max-width: 560px; margin: 18px auto 0; }
.lg-slide-pos { margin: 16px 0 0; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lg-slide.end .lg-row { margin-top: 8px; }
.lg-cv-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lg-cv-count { font-weight: 800; color: var(--muted); font-size: 14px; }
.lg-cv-nav .lg-btn { min-width: 140px; }
@media (max-width: 600px) {
  .lg-cv-top { flex-wrap: wrap; }
  .lg-cv-sel { order: 4; max-width: none; width: 100%; }
  .lg-slide { padding: 22px 16px; border-radius: 22px; }
  .lg-cv-nav .lg-btn { min-width: 0; flex: 1; padding: 12px; }
  .lg-unit-h { grid-template-columns: auto auto 1fr; }
  .lg-learn { padding: 0 10px; }
}
.lg-cv-bar { flex: none; height: 10px; }
.lg-cv-nav .lg-btn { white-space: nowrap; }
@media (max-width: 600px) { .lg-cv-nav .lg-btn { font-size: 14px; letter-spacing: .02em; } }

/* Hidden player and friend codes (secret.js): dots and a Show button. */
.mct-secret { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.mct-secret-v { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .08em; }
.mct-secret-btn { appearance: none; border: 1px solid currentColor; background: transparent; color: inherit; opacity: .85; font: 700 12px/1 system-ui, sans-serif; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.mct-secret-btn:hover, .mct-secret-btn:focus-visible { opacity: 1; }
