/* TecleaHéroes · estilos */
:root {
  --ink: #1E1B4B; --ink-2: #3F3D8F; --ink-3: #5B5A8A; --ground: #F1F1F8; --white: #FFFFFF; --line: #E4E4EF; --line-2: #CFCFE2;
  --lime: #C8F169; --lime-d: #8FB83A; --lime-soft: #F2FBDA;
  --bad: #A3260F; --bad-bg: #FDE2DE; --warn-bg: #FFF4D6;
  --f-p: #F6C9A8; --f-r: #F3E3A1; --f-m: #C8F169; --f-i: #B9D3F0; --f-t: #E4E4EF;
  --sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --r: 14px; --r-lg: 22px;
  --u: clamp(26px, 4.1vw, 54px); --g: clamp(3px, .45vw, 6px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 17px/1.5 var(--sans); }
a { color: var(--ink-2); }
a:hover { color: var(--ink); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; }
h2 { font-size: 21px; font-weight: 700; }
p { margin: 0 0 .8em; }
small, .small { font-size: 14px; }
.muted { color: var(--ink-3); }
.lead { font-size: 19px; max-width: 62ch; color: var(--ink-2); }
kbd { display: inline-block; min-width: 1.8em; padding: 2px 6px; margin: 0 2px; border: 2px solid var(--ink); border-radius: 8px; background: var(--f-r); font: 700 15px var(--sans); text-align: center; box-shadow: 0 2px 0 var(--ink); }
code { font-family: var(--mono); font-size: .9em; background: var(--white); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); }
:focus-visible { outline: 3px solid var(--ink-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Cabecera */
.topbar { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 12px clamp(16px, 3vw, 32px); background: var(--white); border-bottom: 2px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 21px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand-key { width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: var(--lime); display: grid; place-items: center; box-shadow: 0 4px 0 var(--ink-2); }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.topnav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 500; color: var(--ink-2); }
.topnav a:hover { background: var(--ground); }
.topnav a.on { background: var(--ink); color: var(--white); }
.me { display: flex; align-items: center; gap: 10px; }
.me form { margin: 0; }
.me-name { font-weight: 500; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 28px clamp(14px, 3vw, 28px) 60px; }
.wrap.narrow { max-width: 760px; }

/* Avatares */
.avatar { --av: #B9D3F0; display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--av); border: 3px solid var(--ink); font-size: 24px; line-height: 1; flex: none; }
.avatar.sm { width: 34px; height: 34px; font-size: 17px; border-width: 2px; }
.avatar.xs { width: 26px; height: 26px; font-size: 14px; border-width: 2px; }
.avatar.lg { width: 84px; height: 84px; font-size: 44px; border-width: 4px; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: var(--r); border: 0; background: var(--ink); color: var(--white); font: 700 17px var(--sans); text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 var(--ink-2); transition: transform .06s, box-shadow .06s; }
.btn:hover { color: var(--white); background: #2A2663; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.big { min-height: 56px; padding: 0 28px; font-size: 19px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 15px; box-shadow: none; }
.btn.lime { background: var(--lime); color: var(--ink); box-shadow: 0 4px 0 var(--lime-d); }
.btn.lime:hover { background: #BCE85A; color: var(--ink); }
.btn.ghost { background: var(--white); color: var(--ink); border: 2px solid var(--ink); box-shadow: none; }
.btn.ghost:hover { background: var(--ground); }
.btn.danger { background: var(--bad); box-shadow: 0 4px 0 #6E1606; }
.icon-btn { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--white); border: 2px solid var(--line-2); color: var(--ink); flex: none; }

/* Mensajes */
.flash { padding: 12px 16px; border-radius: var(--r); background: var(--lime-soft); border: 2px solid var(--lime-d); font-weight: 500; }
.flash.bad { background: var(--bad-bg); border-color: var(--bad); color: #6E1606; }
.flash.warn { background: var(--warn-bg); border-color: #E0B341; }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; background: var(--line); color: var(--ink-2); font-size: 14px; font-weight: 700; white-space: nowrap; }
.tag.ok { background: var(--lime); color: var(--ink); }
.tag.now { background: var(--ink); color: var(--white); }

/* Paneles y formularios */
.panel { background: var(--white); border: 2px solid var(--line); border-radius: var(--r-lg); padding: clamp(18px, 2.4vw, 26px); margin-bottom: 18px; }
.empty { text-align: center; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 15px; margin-bottom: 14px; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea, .custom-box textarea {
  font: 400 17px var(--sans); color: var(--ink); min-height: 46px; padding: 10px 12px; border: 2px solid var(--line-2); border-radius: 12px; background: var(--white); width: 100%; }
.form input:focus, .form select:focus, textarea:focus { border-color: var(--ink-2); outline: none; box-shadow: 0 0 0 3px rgba(63, 61, 143, .2); }
.form label.check, .radios label { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
.form input[type=checkbox], .form input[type=radio] { width: 20px; height: 20px; accent-color: var(--ink); }
.radios { border: 0; padding: 0; margin: 0 0 14px; }
.radios legend { font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); column-gap: 16px; }
.hint { color: var(--ink-3); font-size: 15px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; }
.checks .ok { color: #3D6B0E; } .checks .no { color: var(--bad); }
.danger-zone { border-top: 2px dashed var(--line); margin-top: 18px; padding-top: 14px; }
.cards { display: grid; gap: 14px; margin-bottom: 18px; }
.profile-edit { margin: 0; }
.profile-edit summary { display: flex; align-items: center; gap: 14px; cursor: pointer; list-style: none; }
.profile-edit summary::-webkit-details-marker { display: none; }
.profile-edit summary > span:nth-child(2) { flex: 1; }
.profile-edit[open] summary { margin-bottom: 18px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head-row h1 { margin: 0; }
.coins { font-weight: 700; background: var(--f-r); border: 2px solid var(--ink); padding: 6px 14px; border-radius: 999px; }

/* Entrar */
.login { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: clamp(20px, 5vw, 64px); align-items: center; min-height: 70vh; }
.login-hero h1 { font-size: clamp(40px, 7vw, 76px); letter-spacing: -0.04em; margin-bottom: 14px; }
.login-hero p { font-size: 20px; color: var(--ink-2); max-width: 32ch; }
.mini-keys { display: flex; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.mini-keys .k { width: 54px; height: 54px; border-radius: 12px; border: 3px solid var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 22px; box-shadow: 0 5px 0 var(--ink); position: relative; }
.mini-keys .gap { width: 22px; }
.mini-keys .bump::after { content: ''; position: absolute; bottom: 9px; width: 16px; height: 3px; border-radius: 2px; background: var(--ink); }
.login-form { margin: 0; }
@media (max-width: 760px) { .login { grid-template-columns: 1fr; min-height: 0; } }

/* Colores de los dedos */
.f-p { background: var(--f-p); } .f-r { background: var(--f-r); } .f-m { background: var(--f-m); } .f-i { background: var(--f-i); } .f-t { background: var(--f-t); } .f-n { background: #F4F4FA; }

/* Columnas */
.cols { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.cols .grow { flex: 999 1 560px; min-width: 0; }
.cols .side { flex: 1 1 300px; min-width: 0; }
.scroll-x { overflow-x: auto; }

/* Ruta del chico */
.hero-bar { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; background: var(--ink); color: var(--white); border-radius: var(--r-lg); padding: 22px 26px; margin-bottom: 22px; }
.hero-bar .avatar { border-color: var(--white); }
.hero-main { flex: 1 1 280px; }
.hero-main h1 { color: var(--white); font-size: 30px; margin-bottom: 10px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.lvl { font-size: 16px; background: var(--lime); color: var(--ink); padding: 3px 12px; border-radius: 999px; letter-spacing: 0; }
.xpbar { height: 14px; background: var(--ink-2); border-radius: 999px; overflow: hidden; }
.xpbar span { display: block; height: 100%; background: var(--lime); border-radius: 999px; }
.hero-sub { margin: 8px 0 0; color: #D4D3EE; font-size: 15px; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stats div { min-width: 92px; background: var(--ink-2); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; align-items: center; }
.hero-stats strong { font-size: 28px; line-height: 1.1; }
.hero-stats span { font-size: 13px; color: #E7E6F7; }
.next-card { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; column-gap: 20px; align-items: center; padding: 22px 26px; border-radius: var(--r-lg); background: var(--lime); color: var(--ink); text-decoration: none; margin-bottom: 18px; border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); }
.next-card:hover { color: var(--ink); }
.next-l { font-size: 15px; font-weight: 500; }
.next-t { font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -0.02em; }
.next-s { font-size: 15px; }
.next-card .btn { grid-column: 2; grid-row: 1 / 4; background: var(--ink); color: var(--white); box-shadow: 0 4px 0 var(--ink-2); }
@media (max-width: 560px) { .next-card { grid-template-columns: 1fr; } .next-card .btn { grid-column: 1; grid-row: auto; margin-top: 12px; } }
.stage { background: var(--white); border: 2px solid var(--line); border-radius: var(--r-lg); margin-bottom: 12px; }
.stage.current { border: 3px solid var(--ink); }
.stage.locked { opacity: .62; }
.stage summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; }
.stage summary::-webkit-details-marker { display: none; }
.stage-n { width: 44px; height: 44px; border-radius: 12px; background: var(--ink); color: var(--white); display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }
.stage.done .stage-n { background: var(--lime); color: var(--ink); }
.stage-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.stage-txt strong { font-size: 19px; }
.stage-txt span { font-size: 15px; color: var(--ink-3); }
.nodes { list-style: none; margin: 0; padding: 0 18px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.node a, .node > span { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; text-decoration: none; color: var(--ink); padding: 6px 4px; border-radius: 14px; }
.node a:hover { background: var(--ground); }
.node-dot { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 19px; background: var(--white); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.node.ok .node-dot { background: var(--lime); }
.node.now .node-dot { background: var(--ink); color: var(--white); box-shadow: 0 0 0 6px var(--lime), 0 4px 0 var(--ink); }
.node.lock .node-dot { border-color: var(--line-2); color: var(--line-2); box-shadow: none; }
.node.lock { color: var(--ink-3); }
.node.boss .node-dot { border-radius: 16px; width: 60px; }
.node-t { font-size: 14px; line-height: 1.25; font-weight: 500; }
.node-s { font-size: 14px; letter-spacing: 1px; min-height: 1em; color: var(--ink); }
.goal { text-align: center; }
.ring { --p: 0; width: 140px; height: 140px; margin: 6px auto 12px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--lime-d) calc(var(--p) * 1%), var(--line) 0); }
.ring span { width: 108px; height: 108px; border-radius: 50%; background: var(--white); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; }
.ring small { font-size: 13px; font-weight: 400; }
.weak { display: flex; gap: 6px; flex-wrap: wrap; }
.race-cta { background: var(--ink); color: var(--white); border-color: var(--ink); }
.race-cta h2 { color: var(--white); }

/* Insignias y tienda */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.small-badges { grid-template-columns: 1fr; margin-bottom: 10px; }
.badge { display: inline-block; padding: 6px 12px; border-radius: 12px; background: var(--line); font-weight: 700; font-size: 15px; }
.badge.got { background: var(--lime); }
.badge.big { font-size: 18px; padding: 10px 16px; }
.badge-card { border: 2px dashed var(--line-2); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; color: var(--ink-3); }
.badge-card strong { color: var(--ink-2); }
.badge-card.got { border: 3px solid var(--ink); background: var(--lime-soft); color: var(--ink); }
.badge-card.got strong { color: var(--ink); }
.badge-card em { font-style: normal; font-size: 13px; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-bottom: 22px; }
.shop form { margin: 0; }
.shop-item { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 16px; border: 2px solid var(--line); background: var(--white); cursor: pointer; font: 500 14px var(--sans); color: var(--ink); }
.shop-item:hover { border-color: var(--ink-2); }
.shop-item.on { border: 3px solid var(--ink); background: var(--lime-soft); }
.shop-ico { font-size: 36px; line-height: 1; }
.shop-ico.swatch { width: 40px; height: 40px; border-radius: 50%; background: var(--av); border: 3px solid var(--ink); }

/* Panel de padres */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 8px; border-radius: 999px; border: 2px solid var(--line-2); background: var(--white); text-decoration: none; font-weight: 700; color: var(--ink); }
.tab.on { background: var(--ink); color: var(--white); border-color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--white); border: 2px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.kpi-l { font-size: 15px; color: var(--ink-3); }
.kpi-v { font-size: 38px; font-weight: 700; letter-spacing: -0.03em; }
.kpi-v small { font-size: 17px; font-weight: 500; letter-spacing: 0; }
.kpi-d { font-size: 14px; color: var(--ink-2); }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--line-2); }
.chart .bar.ok { fill: var(--lime-d); }
.chart .bar-l { font: 700 12px var(--sans); fill: var(--ink); text-anchor: middle; }
.chart .bar-a { font: 500 11px var(--sans); fill: var(--ink-3); text-anchor: middle; }
.heat { display: flex; flex-direction: column; gap: 6px; padding-bottom: 6px; }
.heat-row { display: flex; gap: 6px; }
.hk { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; font-weight: 700; flex: none; border: 1px solid var(--line-2); }
.legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.legend .hk { width: 18px; height: 14px; border-radius: 4px; }
.h0 { background: #F4F4FA; color: var(--ink-3); } .h1 { background: var(--lime-soft); } .h2 { background: var(--f-p); } .h3 { background: #E58A55; } .h4 { background: #8A3B12; color: var(--white); }
.meter { margin-bottom: 12px; }
.meter-top { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; margin-bottom: 4px; }
.meter-bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: var(--ink); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-weight: 500; color: var(--ink-3); padding: 8px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); }
.try-stage summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.try-list { columns: 2 240px; margin: 6px 0 12px; }

/* Lección */
.lesson-page .wrap { padding-top: 18px; }
.lesson-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.lesson-title { flex: 1 1 260px; }
.lesson-title h1 { margin: 2px 0 0; font-size: clamp(24px, 3vw, 32px); }
.live { display: flex; gap: 8px; flex-wrap: wrap; }
.live div { min-width: 86px; background: var(--white); border: 2px solid var(--line); border-radius: 14px; padding: 6px 12px; display: flex; flex-direction: column; }
.live strong { font-size: 24px; line-height: 1.2; }
.live span { font-size: 13px; color: var(--ink-3); }
.bars { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { width: 96px; font-size: 14px; color: var(--ink-3); flex: none; }
.progress { flex: 1; height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 999px; transition: width .15s linear; }
.progress.ghost span { background: repeating-linear-gradient(45deg, var(--ink-3) 0 6px, #8F8EB8 6px 12px); }
.intro { text-align: center; }
.intro-keys { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.big-key { width: 92px; height: 92px; border-radius: 18px; border: 4px solid var(--ink); box-shadow: 0 7px 0 var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; font: 700 40px var(--sans); line-height: 1; }
.big-key small { font-size: 11px; font-weight: 500; margin-top: 6px; max-width: 84px; line-height: 1.15; }
.intro-tip { font-size: 21px; max-width: 46ch; margin: 0 auto 16px; }
.custom-box { display: flex; flex-direction: column; gap: 6px; text-align: left; font-weight: 500; max-width: 720px; margin: 0 auto 16px; }
.custom-box textarea { resize: vertical; }
.typing { position: relative; cursor: text; }
.lines { font: 500 clamp(22px, 3.2vw, 38px)/1.45 var(--mono); min-height: 3.6em; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.ln { white-space: pre-wrap; word-break: break-word; max-width: 100%; }
.ln.done { color: var(--line-2); font-size: .62em; }
.ln.next { color: var(--ink-3); font-size: .62em; opacity: .8; }
.ln.hidden { letter-spacing: .04em; }
.c { border-radius: 6px; padding: 0 1px; }
.c.ok { color: var(--lime-d); }
.c.todo { color: var(--ink); }
.c.now { background: var(--ink); color: var(--white); box-shadow: 0 3px 0 var(--lime); }
.c.now.sp { display: inline-block; min-width: .6em; }
.c.now.oops { background: var(--bad-bg); color: var(--bad); box-shadow: 0 3px 0 var(--bad); animation: shake .18s; }
.c.bad { background: var(--bad-bg); color: var(--bad); text-decoration: underline wavy; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.typing .hint { text-align: center; margin-top: 14px; min-height: 1.6em; font-size: 18px; font-weight: 500; color: var(--ink-2); }
.typing .hint.bad { color: var(--bad); }
.dict-ctl { text-align: center; margin-top: 10px; }
.focus-cover { position: absolute; inset: 0; border-radius: var(--r-lg); border: 0; background: rgba(241, 241, 248, .92); font: 700 20px var(--sans); color: var(--ink); cursor: pointer; }
.catcher { position: fixed; left: -9999px; top: 0; width: 10px; height: 10px; opacity: 0; }
.result { text-align: center; }
.res-head h2 { font-size: clamp(26px, 3.4vw, 36px); }
.res-stars { display: block; font-size: 54px; letter-spacing: 6px; color: var(--ink); line-height: 1.1; }
.res-head.ok .res-stars { color: var(--lime-d); }
.res-stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 16px; }
.res-stats div { min-width: 120px; padding: 10px 14px; border-radius: 16px; background: var(--ground); display: flex; flex-direction: column; }
.res-stats strong { font-size: 30px; }
.res-stats span { font-size: 14px; color: var(--ink-3); }
.gains { font-size: 22px; font-weight: 700; }
.levelup { font-size: 24px; font-weight: 700; background: var(--ink); color: var(--lime); display: inline-block; padding: 8px 18px; border-radius: 14px; }
.res-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

/* Teclado en pantalla */
.kb-wrap { margin-top: 18px; padding: 16px; background: var(--white); border: 2px solid var(--line); border-radius: var(--r-lg); }
.kb { display: flex; flex-direction: column; gap: var(--g); width: max-content; margin: 0 auto; }
.kb-row { display: flex; gap: var(--g); }
.key { --w: 1; position: relative; width: calc(var(--u) * var(--w) + (var(--w) - 1) * var(--g)); height: var(--u); border-radius: calc(var(--u) * .2); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; font: 700 calc(var(--u) * .36) var(--sans); box-shadow: 0 3px 0 #A5A4CC; transition: transform .08s; }
.key.special { font-size: calc(var(--u) * .24); font-weight: 500; }
.key.f-n { background: #F4F4FA; border-color: var(--line-2); color: var(--ink-3); box-shadow: none; }
.key .k-sh { position: absolute; top: 2px; left: 5px; font-size: calc(var(--u) * .22); font-weight: 500; opacity: .75; }
.key .k-ag { position: absolute; bottom: 2px; right: 5px; font-size: calc(var(--u) * .2); font-weight: 500; opacity: .6; }
.key.bump::after { content: ''; position: absolute; bottom: 16%; width: 28%; height: 3px; border-radius: 2px; background: var(--ink); }
.key.target { background: var(--ink); color: var(--white); transform: translateY(-3px); box-shadow: 0 0 0 4px var(--white), 0 0 0 7px var(--ink); z-index: 1; }
.key.target.bump::after { background: var(--lime); }
.key.target2 { background: var(--ink-2); color: var(--white); box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--ink-2); }
.key.wrong { background: var(--bad-bg) !important; border-color: var(--bad); color: var(--bad) !important; animation: shake .2s; }
.hands { display: flex; justify-content: center; gap: clamp(24px, 8vw, 90px); margin-top: 14px; flex-wrap: wrap; }
.hand { display: flex; flex-direction: column; align-items: center; gap: 0; }
.fingers { display: flex; align-items: flex-end; gap: 6px; }
.finger { --h: 60px; width: 28px; height: var(--h); border-radius: 14px 14px 8px 8px; border: 3px solid var(--ink); border-bottom: 0; transition: transform .1s; }
.finger.on { background: var(--ink); transform: translateY(-6px); box-shadow: 0 0 0 3px var(--lime); }
.palm { width: 172px; height: 34px; background: var(--line); border: 3px solid var(--ink); border-radius: 10px 10px 26px 26px; }
.hand-l { font-size: 14px; color: var(--ink-3); margin-top: 6px; }

/* Carrera */
.race-pick .pick-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.room-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.room-code { font: 700 clamp(38px, 6vw, 58px)/1 var(--mono); letter-spacing: .12em; }
.room-mode { background: var(--ink); color: var(--white); padding: 8px 16px; border-radius: 999px; font-weight: 500; font-size: 15px; }
.track { background: var(--ink); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.lane { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lane-who { width: 190px; display: flex; flex-direction: column; color: var(--white); }
.lane-who span { font-size: 14px; color: #D4D3EE; }
.lane.mine .lane-who strong { color: var(--lime); }
.lane-road { --pad: 32px; flex: 1 1 360px; position: relative; height: 64px; border-radius: 14px; background: var(--ink-2); border: 2px dashed #6B6A9E; }
.lane.mine .lane-road { border-color: var(--lime); }
.lane-flag { position: absolute; top: 4px; bottom: 4px; right: 10px; width: 14px; border-radius: 3px; background: repeating-linear-gradient(0deg, var(--white) 0 7px, var(--ink) 7px 14px); }
.runner { --x: 0; position: absolute; top: 50%; left: calc(var(--pad) + var(--x) * (100% - var(--pad) * 2 - 10px)); transform: translate(-50%, -50%); width: 50px; height: 50px; border-radius: 50%; background: var(--av); border: 3px solid var(--ink); display: grid; place-items: center; font-size: 26px; transition: left .35s linear; }
.lane.mine .runner { border-color: var(--white); box-shadow: 0 0 0 3px var(--lime); }
.lobby { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.lobby-txt { flex: 1 1 360px; }
.lobby-ctl { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 16px 0 6px; border-radius: 999px; border: 2px solid var(--ink); background: var(--white); font: 700 16px var(--sans); color: var(--ink); cursor: pointer; }
.switch .sw { width: 54px; height: 32px; border-radius: 999px; background: var(--line-2); position: relative; }
.switch .sw span { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--white); border: 2px solid var(--ink); transition: left .15s; }
.switch[aria-pressed=true] .sw { background: var(--lime-d); }
.switch[aria-pressed=true] .sw span { left: 26px; }
.countdown { display: flex; flex-direction: column; align-items: center; padding: 10px; }
.countdown span { font: 700 110px/1 var(--sans); }
.pods { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.pod { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 16px; background: var(--ground); }
.pod.first { background: var(--lime); }
.pod-n { font-size: 30px; font-weight: 700; width: 48px; }
.pod-t { display: flex; flex-direction: column; }
.pod-t span { font-size: 15px; }
@media (max-width: 640px) { .lane-who { width: 100%; } .me-name { display: none; } }

/* Familias (administración) */
.narrow-box { max-width: 640px; margin: 0 auto; }
.flash.cred { background: var(--ink); color: var(--white); border-color: var(--ink); font-size: 18px; }
.family summary { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.family summary::-webkit-details-marker { display: none; }
.family .fam-name { flex: 1 1 240px; font-size: 19px; }
.family[open] summary { margin-bottom: 16px; }
.family.off { opacity: .7; }
.family h3 { font-size: 17px; margin-top: 8px; }
.parent-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.parent-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--ground); }
.parent-list form { margin: 0; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.inline-form label { flex: 1 1 200px; margin-bottom: 0; }
.danger-zone form { margin-bottom: 12px; }
.site-foot { max-width: 1160px; margin: 0 auto; padding: 0 clamp(14px, 3vw, 28px) 32px; text-align: center; font-size: 14px; }
.site-foot a { color: var(--ink-3); }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: 6px; }
.bar-pct { width: 52px; flex: none; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.prog-text { margin: 2px 0 0 106px; font-size: 16px; font-weight: 500; color: var(--ink-2); min-height: 1.5em; font-variant-numeric: tabular-nums; }
.intro-len { font-size: 17px; font-weight: 500; color: var(--ink-2); margin: 0 auto 16px; }
@media (max-width: 560px) { .bar-label { width: 72px; } .prog-text { margin-left: 0; } }
