/* Menglobe Informática · estilo alineado con menglobe.online
   Crema + verde bosque + lima, DM Sans con acentos en Playfair Display itálica. */
:root {
  --cream: #f3f0e9;
  --forest: #0a2d25;
  --ink: #10241f;
  --lime: #c9ff45;
  --green: #75c81e;
  --green-dark: #4e8514;
  --sand: #f0cda8;
  --sage: #8fb4a7;
  --red: #d64545;
  --red-soft: #fbe3df;
  --flame: #f08a4b;
  --star: #e9b949;

  --bg: var(--cream);
  --surface: #fbfaf6;
  --surface-2: #ebe7dd;
  --border: rgba(16, 36, 31, .12);
  --border-strong: rgba(16, 36, 31, .24);
  --text: var(--ink);
  --muted: #5c6964;
  --key: #fbfaf6;
  --key-edge: rgba(16, 36, 31, .18);
  --ok: var(--green-dark);
  --cursor-bg: var(--lime);
  --panel: var(--forest);
  --panel-text: #ffffff;
  --brand: var(--green-dark);
  --brand-ink: var(--forest);

  --radius: 18px;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1f1a;
    --surface: #10241f;
    --surface-2: #17302a;
    --border: rgba(255, 255, 255, .1);
    --border-strong: rgba(255, 255, 255, .2);
    --text: #eef2ec;
    --muted: #9fb3aa;
    --key: #17302a;
    --key-edge: rgba(0, 0, 0, .4);
    --ok: var(--green);
    --red-soft: #4a2420;
    --panel: #06201a;
    --brand: var(--lime);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.1; margin: 0 0 .4em; font-weight: 700; letter-spacing: -.02em; }
h1 em, h2 em, h3 em, .display em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
kbd {
  font-family: var(--mono);
  font-size: .85em;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0 .4em;
}
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.error { color: var(--red); font-weight: 700; }
[hidden] { display: none !important; }

.icon { width: 1.2em; height: 1.2em; vertical-align: -.22em; flex-shrink: 0; }
.c-flame { color: var(--flame); }
.c-bolt { color: var(--green); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
  font-size: .72rem;
  color: var(--green-dark);
  margin-bottom: .9em;
}
.eyebrow::before { content: ''; width: 28px; height: 2px; background: currentColor; }
.eyebrow-lime { color: var(--lime); }
.display { font-size: clamp(1.9rem, 4.5vw, 3rem); }

/* ---------- Botones (píldora, como menglobe.online) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .75em 1.5em;
  font: inherit;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s, background-color .15s, border-color .15s, box-shadow .15s;
  user-select: none;
}
.btn:hover { border-color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--lime); border-color: var(--lime); color: var(--forest); }
.btn-primary:hover { border-color: var(--lime); box-shadow: 0 0 0 4px rgba(201, 255, 69, .35); }
.btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ghost:hover { border-color: #fff; }
.btn-lg { padding: 1em 1.9em; font-size: .82rem; }
.btn-sm { padding: .55em 1.1em; font-size: .7rem; }
.btn-block { width: 100%; margin-top: .6em; }
.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--brand); cursor: pointer; text-decoration: underline; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
}
.icon-btn:hover { color: var(--text); border-color: var(--text); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px max(16px, calc((100vw - 1140px) / 2));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; white-space: nowrap; }
.brand-logo { display: block; height: 48px; width: auto; }
.brand-tag {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--forest);
  font-weight: 800;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-logo { height: auto; width: min(260px, 80%); margin-bottom: 16px; }
@media (prefers-color-scheme: dark) {
  .brand-logo { background: #fff; border-radius: 10px; padding: 3px 8px; box-sizing: content-box; }
}
.top-stats { display: flex; align-items: center; gap: 6px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: .9rem;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.pill b { color: var(--text); }
.user-pill { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--border); }
.user-pill:hover { border-color: var(--text); }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--lime);
  font-weight: 800;
  font-size: 1.7rem;
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: .95rem; }

/* ---------- Páginas ---------- */
.app { padding-bottom: 72px; }
.boot { padding: 80px 16px; text-align: center; color: var(--muted); }
.page { max-width: 1140px; margin: 0 auto; padding: 28px 16px; }
.page.narrow { max-width: 460px; }
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.side-col { position: sticky; top: 88px; display: grid; gap: 16px; }
.section-title { font-size: 1.3rem; margin: 32px 0 14px; }
.section-head { margin: 24px 0 20px; }

/* Hero (panel verde bosque) */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 24px;
  max-width: 1140px;
  margin: 24px auto 0;
  padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 64px);
  background: var(--panel);
  color: var(--panel-text);
  border-radius: 28px;
}
.hero::after {
  content: '';
  position: absolute;
  right: -120px;
  top: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 255, 69, .22), transparent 65%);
  pointer-events: none;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); letter-spacing: -.045em; margin-bottom: .35em; }
.hero h1 em { color: rgba(255, 255, 255, .75); }
.lead { font-size: 1.1rem; color: rgba(255, 255, 255, .82); max-width: 34em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-art { position: relative; height: 240px; }
.hero-key {
  position: absolute;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  font-size: 2.2rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--forest);
  background: var(--cream);
  border-radius: 20px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .25);
  animation: float 5s ease-in-out infinite;
}
.hero-key.k0 { left: 6%; top: 24px; background: var(--lime); }
.hero-key.k1 { left: 46%; top: 0; animation-delay: -1.2s; }
.hero-key.k2 { left: 22%; top: 136px; background: var(--sand); animation-delay: -2.4s; }
.hero-key.k3 { left: 62%; top: 120px; background: var(--sage); animation-delay: -3.6s; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-3deg); } }

/* Lista numerada de cursos */
.course-list { border-top: 1px solid var(--border-strong); }
.course-row {
  display: grid;
  grid-template-columns: 44px 48px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 20px 8px;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text);
  text-decoration: none;
  transition: background-color .15s, padding .2s;
}
a.course-row:hover { background: var(--surface); padding-left: 16px; }
.row-num { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--lime); color: var(--forest); font-size: 1.2rem; }
.soon .row-icon { background: var(--surface-2); color: var(--muted); }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-title { font-size: clamp(1.3rem, 2.6vw, 1.8rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.soon .row-title { color: var(--muted); }
.row-desc { font-size: .9rem; color: var(--muted); }
.row-progress { height: 4px; margin-top: 10px; max-width: 320px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.row-progress > span { display: block; height: 100%; background: var(--green); }
.row-tag { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

.goal-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.goal-bar > div { height: 100%; background: var(--green); border-radius: 99px; transition: width .4s; }

/* ---------- Mapa del curso ---------- */
.course-head { margin-bottom: 8px; }
.back-link { color: var(--muted); text-decoration: none; font-weight: 700; font-size: .85rem; }
.back-link:hover { color: var(--text); }
.course-head .eyebrow { margin-top: 14px; }
.course-summary { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 8px; }
.toc-chip {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-weight: 700;
  font-size: .82rem;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--border-strong);
}
.toc-chip:hover { border-color: var(--text); color: var(--text); }
.toc-done { background: var(--forest); border-color: var(--forest); color: var(--lime); }
.toc-current { background: var(--lime); border-color: var(--lime); color: var(--forest); }
.toc-locked { opacity: .5; }

.unit { margin: 14px 0 8px; }
.unit-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  background: var(--panel);
  color: var(--panel-text);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.unit-banner::-webkit-details-marker { display: none; }
.unit-banner > div { flex: 1; }
.unit-banner h2 { font-size: 1.5rem; margin: 0 0 .25em; }
.unit-banner p { margin: 0; color: rgba(255, 255, 255, .78); font-size: .95rem; }
.unit-banner .unit-kicker { text-transform: uppercase; font-size: .68rem; font-weight: 700; letter-spacing: .14em; color: var(--lime); margin-bottom: 6px; }
.unit-banner .icon { width: 1em; height: 1em; vertical-align: -.12em; }
.unit-locked { background: var(--surface-2); color: var(--muted); }
.unit-locked p, .unit-locked .unit-kicker { color: var(--muted); }
.unit-goal { font-weight: 700; color: var(--sand) !important; }
.unit-toggle { width: 12px; height: 12px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; margin: 0 8px 6px 0; }
.unit[open] .unit-toggle { transform: rotate(-135deg); margin: 6px 8px 0 0; }

.path { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 28px 0 8px; }
.node-wrap { position: relative; display: flex; flex-direction: column; align-items: center; width: 180px; }
.node {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  font-size: 1.6rem;
  color: var(--forest);
  background: var(--surface);
  border: 2px solid var(--forest);
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s;
}
.node:hover { transform: scale(1.06); }
.node-done { background: var(--forest); color: var(--lime); }
.node-open { background: var(--surface); }
.node-locked { background: transparent; color: var(--muted); border: 2px dashed var(--border-strong); cursor: not-allowed; }
.node-current { background: var(--lime); border-color: var(--lime); box-shadow: 0 0 0 8px rgba(201, 255, 69, .3); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(201, 255, 69, .12); } }
.node-meta { display: flex; flex-direction: column; align-items: center; margin-top: 8px; text-align: center; }
.node-title { font-weight: 500; font-size: .85rem; color: var(--muted); }
.node-num { display: inline-block; min-width: 1.8em; padding: 0 4px; margin-right: 2px; font-size: .7rem; color: var(--muted); border-bottom: 1px solid var(--border-strong); }
.node-bubble {
  position: relative;
  margin-bottom: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--lime);
  font-weight: 800;
  text-transform: uppercase;
  font-size: .66rem;
  letter-spacing: .14em;
  animation: bob 1.6s ease-in-out infinite;
}
.node-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: var(--forest);
  transform: translateX(-50%) rotate(45deg);
}
@keyframes bob { 50% { transform: translateY(-4px); } }

.stars { display: inline-flex; gap: 2px; }
.star { color: var(--border-strong); display: inline-flex; }
.star.on { color: var(--star); }
.stars-sm .icon { width: 15px; height: 15px; }
.stars-xl { gap: 8px; }
.stars-xl .star { animation: pop .5s backwards cubic-bezier(.3, 1.6, .5, 1); }
.stars-xl .star:nth-child(2) { animation-delay: .15s; transform: translateY(-12px); }
.stars-xl .star:nth-child(3) { animation-delay: .3s; }
.stars-xl .icon { width: 60px; height: 60px; }
@keyframes pop { from { transform: scale(0); opacity: 0; } }

/* Barra lateral */
.side-card h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 6px; }
.goal { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.goal-bar { flex: 1; }
.goal-text { font-weight: 700; font-size: .85rem; white-space: nowrap; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.mini-stats b { display: block; font-size: 1.15rem; font-weight: 700; }
.mini-stats span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.leaderboard { list-style: none; margin: 0; padding: 0; }
.leaderboard li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); font-weight: 500; }
.leaderboard li:last-child { border-bottom: 0; }
.leaderboard li.me { background: color-mix(in srgb, var(--lime) 35%, transparent); border-radius: 8px; }
.leaderboard .rank { width: 24px; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.leaderboard .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard .xp { font-size: .8rem; color: var(--muted); }

/* ---------- Lección ---------- */
body.focus-mode .topbar { display: none; }
.lesson { max-width: 1000px; margin: 0 auto; padding: 14px 16px 40px; }
.lesson-head { display: flex; align-items: center; gap: 16px; padding: 8px 0 12px; }
.progress { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--green); border-radius: 99px; transition: width .2s; }
.live-stats { display: flex; gap: 14px; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-stats b { color: var(--text); font-size: 1.05rem; }
.lesson-body { text-align: center; }
.lesson-kicker { color: var(--green-dark); font-weight: 700; text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; margin: 10px 0 4px; }
.lesson-title { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 18px; }
.stage { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.intro { width: 100%; max-width: 640px; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px; }
.intro .eyebrow { margin: 0; }
.intro-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.intro-key { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.keycap {
  display: grid;
  place-items: center;
  min-width: 72px;
  height: 72px;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--forest);
  background: var(--finger);
  border-radius: 16px;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .14);
}
.keycap-wide { min-width: 180px; font-size: 1.1rem; font-family: var(--font); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.intro-finger { font-weight: 700; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.intro-combo { font-size: .75rem; color: var(--muted); }
.intro-tip { max-width: 36em; color: var(--muted); margin: 4px 0; }

.typing-box { position: relative; width: 100%; max-width: 860px; padding: 26px 30px; cursor: text; text-align: left; }
.typing-text {
  font-family: var(--mono);
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: break-word;
  max-height: calc(1.8em * 3);
  overflow: hidden;
  color: var(--muted);
}
.ch { border-radius: 4px; transition: background-color .08s; }
.ch.ok { color: var(--ok); }
.ch.fixed { color: var(--ok); text-decoration: underline wavy var(--red); text-decoration-thickness: 1px; text-underline-offset: 6px; }
.ch.err { color: var(--red); background: var(--red-soft); }
.ch.sp.err { background: var(--red); }
.ch.tab { display: inline-block; width: 2.5em; text-align: left; opacity: .6; }
.ch.tab.ok, .ch.tab.fixed { opacity: .35; }
.ch.cur { color: var(--forest); background: var(--cursor-bg); box-shadow: inset 0 -3px 0 var(--forest); animation: caret 1s step-end infinite; }
@keyframes caret { 50% { box-shadow: inset 0 -3px 0 transparent; } }
.focus-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(2px);
  border-radius: inherit;
  font-weight: 700;
  color: var(--text);
}
.typing-input { position: absolute; opacity: 0; width: 1px; height: 1px; left: -100px; pointer-events: none; }
.next-hint { min-height: 1.5em; margin: 0; font-weight: 500; }
.next-hint b { font-family: var(--mono); color: var(--green-dark); }
.shake { animation: shake .25s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* Teclado virtual */
.deck { width: 100%; max-width: 860px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.kb {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  background: var(--panel);
  border-radius: var(--radius);
  user-select: none;
}
.kb-row { display: flex; gap: 5px; }
.key {
  flex-basis: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: clamp(30px, 5vw, 48px);
  font-size: clamp(.6rem, 1.4vw, .92rem);
  font-weight: 700;
  line-height: 1.05;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  border-bottom: 3px solid color-mix(in srgb, var(--finger, transparent) 70%, transparent);
  border-radius: 8px;
  color: rgba(255, 255, 255, .85);
  transition: background-color .1s, transform .05s;
}
.key .k-shift { font-size: .75em; color: rgba(255, 255, 255, .5); }
.key-spacer { visibility: hidden; }
.key-enter-tail { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: -6px; height: calc(clamp(30px, 5vw, 48px) + 6px); border-top: 0; }
.key-home::after { content: ''; position: absolute; bottom: 6px; width: 12px; height: 2px; border-radius: 2px; background: currentColor; opacity: .6; }
.key-next { background: var(--finger); color: var(--forest); border-color: var(--finger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--finger) 40%, transparent); }
.key-next .k-shift { color: rgba(10, 45, 37, .7); }
.key-next-2 { background: color-mix(in srgb, var(--finger) 35%, transparent); }
.key-pressed { animation: press .18s; }
.key-wrong { animation: wrong .3s; }
@keyframes press { 50% { transform: translateY(2px); filter: brightness(.85); } }
@keyframes wrong { 50% { background: var(--red); color: #fff; } }

/* Manos */
.hands { display: flex; align-items: flex-end; justify-content: center; gap: 18px; }
.hand { display: flex; align-items: flex-end; gap: 6px; }
.finger { width: 20px; border-radius: 10px 10px 6px 6px; background: var(--surface-2); border: 1px solid var(--border); transition: background-color .15s, transform .15s; }
.finger-active { background: var(--finger); border-color: var(--finger); transform: translateY(-6px); }
.finger-name { width: 170px; text-align: center; font-weight: 700; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; align-self: center; }

/* Juego de palabras que caen */
.game { width: 100%; max-width: 860px; padding: 12px; display: flex; flex-direction: column; gap: 10px; cursor: text; }
.game-hud { display: flex; justify-content: space-between; align-items: center; font-weight: 700; padding: 0 6px; }
.game-lives { display: flex; gap: 4px; }
.heart { color: var(--border-strong); display: inline-flex; }
.heart.on { color: var(--red); }
.heart .icon { width: 22px; height: 22px; }
.game-field {
  position: relative;
  height: 360px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--panel);
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 22px 22px;
  color: #fff;
}
.game-field.hit { animation: hit .35s; }
@keyframes hit { 30% { background-color: #5a2320; } }
.game-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--red); }
.game-start { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 16px; }
.game-start .muted { color: rgba(255, 255, 255, .65); }
.falling {
  position: absolute;
  top: 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--forest);
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
  white-space: pre;
  will-change: transform;
}
.falling .typed { color: var(--green-dark); text-decoration: underline; }
.falling.active { background: var(--lime); box-shadow: 0 0 0 4px rgba(201, 255, 69, .3); z-index: 1; }
.falling.cleared { transition: opacity .3s, transform .3s; opacity: 0; }
.game-buffer { min-height: 2.2em; text-align: center; font-family: var(--mono); font-size: 1.35rem; font-weight: 700; color: var(--green-dark); }
.game-summary { font-weight: 500; }

/* Resultado */
.result { width: 100%; max-width: 640px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 26px; }
.result h2 { font-size: 2.2rem; margin: 10px 0 0; }
.result.failed h2 { color: var(--red); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; width: 100%; margin: 14px 0; border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); }
.tile { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; }
.tile + .tile { border-left: 1px solid var(--border); }
.tile b { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 4px; }
.tile-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: var(--muted); }
.tile-unit { font-size: .78rem; color: var(--muted); }
.tile-xp b { color: var(--green-dark); }
.problem-keys { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; background: var(--red-soft); font-weight: 700; font-size: .85rem; }
.result-actions { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }

/* Perfil */
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-head > div { flex: 1; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 0; }
.tiles-4 { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 12px; }
.table th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 6px 8px; }
.table td { padding: 10px 8px; border-top: 1px solid var(--border); }

/* Acceso */
.auth-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 34px 26px; margin-top: 24px; }
.form { width: 100%; display: grid; gap: 12px; text-align: left; margin: 12px 0; }
.form label { display: grid; gap: 4px; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.form input {
  font: inherit;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: normal;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
}
.form input:focus { outline: none; border-color: var(--green-dark); box-shadow: 0 0 0 3px rgba(117, 200, 30, .25); }
.divider { width: 100%; display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 12px 0 0; font-size: .8rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .with-sidebar { grid-template-columns: 1fr; }
  .side-col { position: static; }
  .hero { grid-template-columns: 1fr; margin: 16px 16px 0; }
  .hero-art { display: none; }
}
@media (max-width: 600px) {
  .brand-logo { height: 34px; }
  .brand-tag, .user-name { display: none; }
  .course-row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; }
  .course-row .row-icon, .course-row .row-tag { display: none; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile:nth-child(3) { border-left: 0; }
  .live-stats span:last-child { display: none; }
  .typing-box { padding: 16px; }
  .kb { padding: 6px; gap: 3px; }
  .kb-row { gap: 3px; }
  .key { border-radius: 5px; }
  .hands { display: none; }
  .profile-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
