/* public/learn.css -- Aprende: panel unico de aprendizaje musical (ver learn.js) */
.ln-launch { position: fixed; right: 16px; bottom: 326px; z-index: 9984; width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid #ffc400; background: linear-gradient(135deg, rgba(255, 196, 0, .32), var(--panel, #14141d)); color: var(--text, #fff); font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 8px 22px rgba(0, 0, 0, .35); }
.ln-launch:hover { transform: scale(1.06); }
.ln-launch:focus-visible { outline: 2px solid #00e5ff; outline-offset: 2px; }
@media (max-width: 640px) { .ln-launch { bottom: 336px; right: 12px; } }
html.ln-open .ln-launch { display: none !important; }
html.bub-grp:not(.bub-grp-open) .ln-launch { display: none !important; }

.ln { position: fixed; inset: 0; z-index: 9990; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(6, 3, 14, .72); backdrop-filter: blur(4px); color: #fff; }
.ln[hidden] { display: none; }
.ln-sheet { position: relative; width: min(980px, 100%); max-height: 100%; display: flex; flex-direction: column; border: 2px solid transparent; border-radius: 26px; background: linear-gradient(#170d2a, #0c0718) padding-box, linear-gradient(135deg, #ffc400, #ff3d9a 45%, #7c5cff 80%, #00e0ff) border-box; box-shadow: 0 24px 70px rgba(0, 0, 0, .65), 0 0 40px rgba(255, 61, 154, .22); overflow: hidden; }
.ln-head { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px 18px; }
.ln-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: calc(1.25 * var(--u)); font-family: var(--font-display, inherit); background: linear-gradient(90deg, #ffd84a, #ff7ac8 55%, #7de8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ln-b { appearance: none; font: inherit; cursor: pointer; flex: 0 0 auto; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff; font-size: calc(0.9 * var(--u)); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ln-b:hover { background: rgba(255, 255, 255, .17); }
.ln-b:focus-visible, .ln-card button:focus-visible, .ln-les button:focus-visible, .ln-lvtab:focus-visible { outline: 2px solid #00e5ff; outline-offset: 2px; }
.ln-x { width: 44px; height: 44px; padding: 0; border-color: #ff3d9a; background: rgba(255, 61, 154, .26); font-size: calc(1.05 * var(--u)); font-weight: 700; }
.ln-x:hover { background: rgba(255, 61, 154, .5); }
.ln-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 18px 20px; display: flex; flex-direction: column; gap: 16px; }

/* progreso */
.ln-hero { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 20px; background: radial-gradient(120% 140% at 0% 0%, rgba(255, 196, 0, .22), transparent 55%), radial-gradient(120% 140% at 100% 100%, rgba(124, 92, 255, .3), transparent 55%), rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .14); }
.ln-lvl { flex: 0 0 auto; width: 74px; height: 74px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: conic-gradient(#ffc400 var(--p, 0%), rgba(255, 255, 255, .12) 0); position: relative; }
.ln-lvl::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #1a1030; }
.ln-lvl > * { position: relative; }
.ln-lvl span { font-size: calc(1.5 * var(--u)); line-height: 1; }
.ln-lvl b { font-size: calc(0.82 * var(--u)); color: #ffd84a; }
.ln-hx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ln-hx h3 { margin: 0; font-size: calc(1.05 * var(--u)); }
.ln-hx small { color: #cfc6ea; font-size: calc(0.82 * var(--u)); }
.ln-bar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.ln-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #ffc400, #ff3d9a, #7c5cff); transition: width .5s; }
.ln-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.ln-chip { font-size: calc(0.82 * var(--u)); padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); white-space: nowrap; }

.ln-goal { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; font-size: calc(0.82 * var(--u)); color: #ffe9a8; }
.ln-bar2 { height: 7px; }
.ln-bar2 i { background: linear-gradient(90deg, #4ade80, #ffc400); }
.ln-goal.is-done { color: #b8f5cf; }
.ln-snd { width: 40px; padding: 0; font-size: calc(1.05 * var(--u)); }

/* siguiente paso */
.ln-next { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; background: linear-gradient(135deg, rgba(255, 61, 154, .3), rgba(0, 224, 255, .18)); border: 1.5px solid #ff7ac8; }
.ln-next .ln-ic { font-size: calc(2 * var(--u)); flex: 0 0 auto; }
.ln-next .ln-tx { flex: 1 1 auto; min-width: 0; }
.ln-next small { display: block; color: #ffd8ef; font-size: calc(0.82 * var(--u)); letter-spacing: .06em; text-transform: uppercase; }
.ln-next b { display: block; font-size: calc(1.02 * var(--u)); }
.ln-next p { margin: 2px 0 0; font-size: calc(0.82 * var(--u)); color: #e8e2fb; }
.ln-go { appearance: none; font: inherit; cursor: pointer; flex: 0 0 auto; padding: 11px 18px; border-radius: 14px; border: 0; background: linear-gradient(135deg, #ff3d9a, #ff8a3d); color: #fff; font-weight: 700; font-size: calc(0.92 * var(--u)); box-shadow: 0 6px 18px rgba(255, 61, 154, .4); }
.ln-go:hover { filter: brightness(1.1); }

.ln-h { margin: 0 0 8px; font-size: calc(1 * var(--u)); display: flex; align-items: center; gap: 8px; }
.ln-h small { font-weight: 400; color: #bdb4dc; font-size: calc(0.82 * var(--u)); }

/* herramientas */
.ln-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ln-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px 12px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .14); background: linear-gradient(160deg, rgb(var(--c) / 30%), rgba(255, 255, 255, .03) 70%); overflow: hidden; }
.ln-card::after { content: attr(data-ico); position: absolute; right: -8px; bottom: -14px; font-size: calc(4.6 * var(--u)); opacity: .13; pointer-events: none; }
.ln-card .ln-ci { font-size: calc(1.9 * var(--u)); line-height: 1; }
.ln-card b { font-size: calc(0.95 * var(--u)); }
.ln-card p { margin: 0; font-size: calc(0.82 * var(--u)); color: #d9d3f0; flex: 1 1 auto; }
.ln-card .ln-row { display: flex; gap: 6px; margin-top: 4px; position: relative; z-index: 1; }
.ln-open { appearance: none; font: inherit; cursor: pointer; flex: 1 1 auto; padding: 8px 10px; border-radius: 11px; border: 1px solid rgb(var(--c)); background: rgb(var(--c) / 28%); color: #fff; font-weight: 700; font-size: calc(0.84 * var(--u)); }
.ln-open:hover { background: rgb(var(--c) / 50%); }
.ln-tv { appearance: none; font: inherit; cursor: pointer; flex: 0 0 auto; width: 38px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: #fff; font-size: calc(1 * var(--u)); }
.ln-tv:hover { background: rgba(255, 255, 255, .2); }
.ln-prog { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.ln-prog i { display: block; height: 100%; background: rgb(var(--c)); width: 0; }

/* ruta */
.ln-lvtabs { display: flex; gap: 8px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.ln-lvtab { appearance: none; font: inherit; cursor: pointer; flex: 1 1 0; min-width: 0; padding: 9px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .05); color: #e8e2fb; font-size: calc(0.84 * var(--u)); text-align: left; display: flex; flex-direction: column; gap: 3px; white-space: nowrap; }
.ln-lvtab b { font-size: calc(0.88 * var(--u)); }
.ln-lvtab small { color: #bdb4dc; font-size: calc(0.82 * var(--u)); }
.ln-lvtab.is-on { border-color: #ffc400; background: linear-gradient(135deg, rgba(255, 196, 0, .22), rgba(255, 61, 154, .16)); color: #fff; }
.ln-lessons { display: flex; flex-direction: column; gap: 8px; }
.ln-les { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); }
.ln-les.is-done { border-color: rgba(80, 220, 140, .5); background: rgba(80, 220, 140, .09); }
.ln-n { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .1); font-size: calc(1.05 * var(--u)); }
.ln-les.is-done .ln-n { background: #28c47a; color: #04230f; font-weight: 800; }
.ln-lx { flex: 1 1 auto; min-width: 0; }
.ln-lx b { display: block; font-size: calc(0.9 * var(--u)); }
.ln-lx small { display: block; color: #cfc6ea; font-size: calc(0.82 * var(--u)); margin-top: 1px; }
.ln-xp { font-size: calc(0.82 * var(--u)); color: #ffd84a; margin-left: 6px; font-weight: 700; }
.ln-lb { display: flex; gap: 6px; flex: 0 0 auto; }
.ln-lb button { appearance: none; font: inherit; cursor: pointer; padding: 7px 12px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .08); color: #fff; font-size: calc(0.82 * var(--u)); white-space: nowrap; }
.ln-lb button:hover { background: rgba(255, 255, 255, .2); }
.ln-lb .ln-start { border-color: #ff7ac8; background: rgba(255, 61, 154, .26); font-weight: 700; }
.ln-auto { font-size: calc(0.82 * var(--u)); color: #7de8ff; margin-left: 6px; }

/* logros */
.ln-medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.ln-medal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 10px 6px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); filter: grayscale(1); opacity: .55; }
.ln-medal.is-on { filter: none; opacity: 1; border-color: #ffc400; background: linear-gradient(160deg, rgba(255, 196, 0, .2), rgba(255, 61, 154, .1)); }
.ln-medal i { font-style: normal; font-size: calc(1.8 * var(--u)); line-height: 1.1; }
.ln-medal b { font-size: calc(0.82 * var(--u)); }
.ln-medal small { font-size: calc(0.82 * var(--u)); color: #cfc6ea; }
.ln-toast { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); max-width: calc(100% - 28px); padding: 10px 16px; border-radius: 14px; background: linear-gradient(135deg, #ffc400, #ff7a3d); color: #1b1300; font-weight: 800; font-size: calc(0.88 * var(--u)); box-shadow: 0 10px 28px rgba(0, 0, 0, .5); pointer-events: none; animation: ln-pop .35s ease-out; z-index: 3; }
.ln-toast[hidden] { display: none; }
@keyframes ln-pop { from { opacity: 0; transform: translate(-50%, 14px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 760px) {
  .ln-tools { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ln { padding: 0; align-items: stretch; }
  .ln-sheet { border-radius: 0; border-width: 0; background: linear-gradient(#170d2a, #0c0718); }
  .ln-head { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .ln-body { padding: 0 12px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .ln-hero { padding: 12px; gap: 12px; }
  .ln-next { flex-wrap: wrap; }
  .ln-go { width: 100%; }
  .ln-les { flex-wrap: wrap; }
  .ln-lb { width: 100%; }
  .ln-lb button { flex: 1 1 0; }
}
@media (prefers-reduced-motion: reduce) { .ln-launch:hover { transform: none; } .ln-bar i { transition: none; } .ln-toast { animation: none; } }

/* Legibilidad: tamaños en px (no dependen del tamaño de letra del sitio, que en modo compacto es chico) y más grandes en pantalla ancha */
.ln-sheet { --u: 16px; font-family: Inter, system-ui, 'Segoe UI', Roboto, Arial, sans-serif; font-weight: 500; line-height: 1.35; letter-spacing: 0; }
.ln-sheet b, .ln-sheet strong { font-weight: 700; }
.ln-title, .ln-lvl b { font-family: var(--font-display, inherit); }
.ln-card p, .ln-next p, .ln-lx small, .ln-hx small, .ln-h small, .ln-lvtab small, .ln-medal small { color: #efeaff; }
.ln-chip, .ln-open, .ln-tv, .ln-lb button, .ln-go { font-size: calc(.9 * var(--u)); }
.ln-open, .ln-lb button { min-height: 40px; }
@media (min-width: 900px) { .ln-sheet { --u: clamp(16px, 1.05vw, 19px); } }
html.bub-full .ln-sheet { --u: clamp(17px, 1.35vw, 24px); }
html.bub-full .ln-body { max-width: 1500px; margin: 0 auto; width: 100%; box-sizing: border-box; }
