/* ============================================================
   NeuroQuiz · Emoción — hoja de estilos
   ============================================================ */

:root{
  --green:#58cc02;  --green-d:#46a302;  --green-s:#d7ffb8;
  --blue:#1cb0f6;   --blue-d:#1899d6;   --blue-s:#ddf4ff;
  --purple:#ce82ff; --purple-d:#a568cc; --purple-s:#f3e4ff;
  --yellow:#ffc800; --yellow-d:#e0a800; --yellow-s:#fff4cc;
  --orange:#ff9600; --red:#ff4b4b;      --red-d:#e63f3f;  --red-s:#ffdfe0;
  --bg:#ffffff; --bg-2:#f7f9fc; --bg-3:#eef3fa;
  --card:#ffffff; --card-2:#fbfcfe;
  --text:#3c3c3c; --text-2:#5a6572; --muted:#8a94a6;
  --border:#e2e8f2; --border-2:#d3dced;
  --shadow-sm:0 2px 6px rgba(23,40,77,.06);
  --shadow:0 10px 30px rgba(23,40,77,.10);
  --shadow-lg:0 24px 60px rgba(23,40,77,.16);
  --radius:20px; --radius-sm:14px;
  --font:'Nunito', ui-rounded, 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ease:cubic-bezier(.2,.9,.25,1);
}

[data-theme="dark"]{
  --bg:#0e1420; --bg-2:#121a28; --bg-3:#182233;
  --card:#16202f; --card-2:#1b2739;
  --text:#eaf1fb; --text-2:#c3cfe2; --muted:#8b9ab2;
  --border:#243247; --border-2:#2d3d56;
  --shadow-sm:0 2px 6px rgba(0,0,0,.35);
  --shadow:0 12px 34px rgba(0,0,0,.45);
  --shadow-lg:0 26px 70px rgba(0,0,0,.55);
  --green-s:#1d3410; --blue-s:#0f2b3c; --red-s:#3a1a1d; --yellow-s:#3a2f08; --purple-s:#2a1840;
}

*,*::before,*::after{ box-sizing:border-box; }

html{ scroll-behavior:smooth; }

body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:var(--bg);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
  overflow-x:hidden;
  transition:background .3s var(--ease), color .3s var(--ease);
}

h1,h2,h3,h4{ margin:0; line-height:1.18; letter-spacing:-.02em; }
p{ margin:0; }
button{ font-family:inherit; }
a{ color:inherit; text-decoration:none; }

:focus-visible{
  outline:3px solid var(--blue);
  outline-offset:3px;
  border-radius:8px;
}

/* ---------- fondo decorativo ---------- */
.orbs{ position:fixed; inset:0; overflow:hidden; pointer-events:none; z-index:0; }
.orb{
  position:absolute; border-radius:50%; filter:blur(80px); opacity:.18;
  animation:float 20s var(--ease) infinite;
}
[data-theme="dark"] .orb{ opacity:.14; }
.orb-1{ width:460px; height:460px; background:var(--green); top:-220px; left:-160px; }
.orb-2{ width:420px; height:420px; background:var(--blue); top:14%; right:-220px; animation-delay:-6s; }
.orb-3{ width:380px; height:380px; background:var(--purple); bottom:-220px; left:38%; animation-delay:-12s; }

/* ---------- topbar ---------- */
.topbar{
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; gap:18px;
  padding:12px clamp(14px,4vw,34px);
  background:var(--bg);
  background:color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter:blur(14px) saturate(140%);
  border-bottom:1px solid var(--border);
}
.brand{ display:flex; align-items:center; gap:10px; margin-right:auto; }
.brand-mark{
  font-size:26px; line-height:1; display:grid; place-items:center;
  width:44px; height:44px; border-radius:14px;
  background:linear-gradient(145deg,var(--green),#8ee000);
  box-shadow:0 4px 0 var(--green-d);
  animation:bob 3.6s var(--ease) infinite;
}
.brand-text{ display:flex; flex-direction:column; line-height:1.1; }
.brand-text strong{ font-size:18px; font-weight:900; letter-spacing:-.03em; }
.brand-text small{ font-size:11.5px; color:var(--muted); font-weight:700; letter-spacing:.02em; }

.nav{ display:flex; gap:4px; }
.nav a{
  padding:9px 16px; border-radius:999px; font-weight:800; font-size:14px;
  color:var(--muted); transition:all .2s var(--ease); position:relative;
}
.nav a:hover{ color:var(--text); background:var(--bg-3); }
.nav a.active{ color:var(--blue-d); background:var(--blue-s); }
.nav-ico{ display:none; }

.top-actions{ display:flex; gap:8px; }
.icon-btn{
  width:42px; height:42px; border-radius:14px; border:2px solid var(--border);
  background:var(--card); font-size:18px; cursor:pointer; display:grid; place-items:center;
  transition:transform .15s var(--ease), border-color .2s, background .2s;
}
.icon-btn:hover{ transform:translateY(-2px); border-color:var(--border-2); }
.icon-btn:active{ transform:translateY(0); }

/* ---------- layout ---------- */
main{
  position:relative; z-index:1;
  max-width:960px; margin:0 auto;
  padding:clamp(20px,4vw,44px) clamp(14px,4vw,28px) 60px;
  outline:none;
}
.screen{ animation:fadeUp .45s var(--ease) both; }

/* ---------- botones ---------- */
.btn{
  --btn:var(--green); --btn-d:var(--green-d); --btn-text:#fff;
  position:relative; display:inline-flex; align-items:center; justify-content:center; gap:9px;
  padding:14px 24px; border:0; border-radius:16px;
  background:var(--btn); color:var(--btn-text);
  font-weight:900; font-size:15.5px; letter-spacing:.2px;
  cursor:pointer; box-shadow:0 4px 0 var(--btn-d);
  transition:transform .1s var(--ease), box-shadow .1s var(--ease), filter .2s;
  text-transform:none; user-select:none;
}
.btn:hover{ filter:brightness(1.04); }
.btn:active:not(:disabled){ transform:translateY(3px); box-shadow:0 1px 0 var(--btn-d); }
.btn:disabled{ opacity:.45; cursor:not-allowed; box-shadow:0 4px 0 var(--btn-d); }
.btn-sm{ padding:10px 16px; font-size:14px; border-radius:12px; box-shadow:0 3px 0 var(--btn-d); }
.btn-lg{ padding:18px 32px; font-size:17px; border-radius:18px; }
.btn-block{ width:100%; }
.btn-blue{ --btn:var(--blue); --btn-d:var(--blue-d); }
.btn-purple{ --btn:var(--purple); --btn-d:var(--purple-d); }
.btn-red{ --btn:var(--red); --btn-d:var(--red-d); }
.btn-yellow{ --btn:var(--yellow); --btn-d:var(--yellow-d); --btn-text:#6b4b00; }
.btn-ghost{
  --btn:transparent; --btn-d:transparent;
  color:var(--text-2); border:2px solid var(--border); box-shadow:none; background:var(--card);
}
.btn-ghost:hover{ border-color:var(--border-2); background:var(--bg-3); }
.btn-ghost:active:not(:disabled){ transform:translateY(2px); box-shadow:none; }

/* ---------- tarjetas ---------- */
.card{
  background:var(--card);
  border:2px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow-sm);
}
.pill{
  display:inline-flex; align-items:center; gap:6px;
  padding:5px 12px; border-radius:999px;
  font-size:12px; font-weight:900; letter-spacing:.03em; text-transform:uppercase;
}
.pill-cap{ background:var(--blue-s); color:var(--blue-d); }
.pill-block{ background:var(--purple-s); color:var(--purple-d); text-transform:none; letter-spacing:0; font-weight:800; }
.pill-facil{ background:var(--green-s); color:var(--green-d); }
.pill-media{ background:var(--yellow-s); color:var(--yellow-d); }
.pill-dificil{ background:var(--red-s); color:var(--red-d); }

/* ---------- HERO ---------- */
.hero{
  position:relative; overflow:hidden; text-align:center;
  padding:clamp(26px,4vw,40px) clamp(18px,4vw,34px) clamp(24px,3vw,34px);
  border-radius:28px; border:2px solid var(--border);
  background:linear-gradient(135deg,#eaffd6 0%,#ddf4ff 48%,#f3e4ff 100%);
  box-shadow:var(--shadow-sm);
}
[data-theme="dark"] .hero{
  background:linear-gradient(135deg,#172a12 0%,#10263a 48%,#241537 100%);
  border-color:var(--border-2);
}
.hero::before{
  content:""; position:absolute; width:280px; height:280px; border-radius:50%;
  background:radial-gradient(circle,#ffffffaa,transparent 70%);
  top:-120px; right:-60px; pointer-events:none;
}
[data-theme="dark"] .hero::before{ background:radial-gradient(circle,#ffffff18,transparent 70%); }
.hero-emoji{
  font-size:56px; display:inline-block; margin-bottom:10px;
  animation:bob 3.2s var(--ease) infinite;
  filter:drop-shadow(0 12px 18px rgba(88,204,2,.28));
}
.hero-kicker{
  font-size:11.5px; font-weight:900; letter-spacing:.14em; text-transform:uppercase;
  color:var(--green-d); margin-bottom:4px;
}
[data-theme="dark"] .hero-kicker{ color:#9ae65a; }
.hero h1{
  font-size:clamp(34px,7vw,56px); font-weight:900; letter-spacing:-.045em;
  background:linear-gradient(100deg,var(--green) 0%,var(--blue) 45%,var(--purple) 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  background-size:200% auto; animation:shine 8s linear infinite;
}
.hero p.lead{
  margin:14px auto 0; max-width:600px; font-size:16.5px; color:var(--text-2); font-weight:600;
}
.hero-badges{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:18px; }
.hero-badges span{
  font-size:12.5px; font-weight:800; color:var(--text-2);
  background:var(--card); border:2px solid var(--border); border-radius:999px; padding:6px 14px;
}

/* ---------- stats strip ---------- */
.strip{
  display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin:26px 0 30px;
}
.stat{
  background:var(--card); border:2px solid var(--border); border-radius:16px;
  padding:14px 12px; text-align:center; box-shadow:var(--shadow-sm);
  transition:transform .2s var(--ease), border-color .2s;
}
.stat:hover{ transform:translateY(-3px); border-color:var(--border-2); }
.stat-ico{ font-size:19px; }
.stat-val{ font-size:23px; font-weight:900; letter-spacing:-.03em; }
.stat-lbl{ font-size:11px; font-weight:800; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }

/* ---------- secciones ---------- */
.section{ margin-top:34px; }
.section-head{ display:flex; align-items:end; justify-content:space-between; gap:14px; margin-bottom:14px; }
.section-title{
  font-size:21px; font-weight:900; letter-spacing:-.025em; display:flex; align-items:center; gap:9px;
}
.section-title::before{
  content:""; width:8px; height:24px; border-radius:99px;
  background:linear-gradient(180deg,var(--green),var(--blue));
}
.section-sub{ font-size:13px; color:var(--muted); font-weight:700; }

/* ---------- modos ---------- */
.modes{ display:grid; grid-template-columns:repeat(2,1fr); gap:14px; }
.mode{
  position:relative; display:flex; gap:14px; align-items:center; text-align:left;
  padding:18px; border-radius:var(--radius); cursor:pointer; overflow:hidden;
  background:var(--card); border:2px solid var(--border);
  box-shadow:var(--shadow-sm);
  transition:transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}
.mode::after{
  content:""; position:absolute; inset:0; opacity:0; transition:opacity .25s;
  background:radial-gradient(400px 160px at 10% 0%, var(--tint,#ddf4ff), transparent 70%);
}
.mode:hover{ transform:translateY(-3px); box-shadow:var(--shadow); border-color:var(--border-2); }
.mode:hover::after{ opacity:1; }
.mode:active{ transform:translateY(-1px) scale(.995); }
.mode-ico{
  flex:0 0 auto; width:52px; height:52px; border-radius:16px; display:grid; place-items:center;
  font-size:24px; background:var(--tint,#eef3fa); z-index:1;
}
.mode-body{ z-index:1; min-width:0; }
.mode-body h3{ font-size:15.5px; font-weight:900; }
.mode-body p{ font-size:12.8px; color:var(--muted); font-weight:700; margin-top:2px; }
.mode-tag{
  display:inline-flex; align-items:center; margin-top:8px;
  font-size:10.5px; font-weight:900; text-transform:uppercase; letter-spacing:.05em;
  padding:3px 9px; border-radius:999px; background:var(--green-s); color:var(--green-d);
}
.mode:disabled{ opacity:.5; cursor:not-allowed; transform:none; }

/* ---------- bloques ---------- */
.blocks{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.block-chip{
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:12px 14px; border-radius:14px; cursor:pointer; text-align:left;
  background:var(--card); border:2px solid var(--border);
  font-size:13px; font-weight:800; color:var(--text-2);
  transition:all .16s var(--ease);
}
.block-chip:hover{ border-color:var(--blue); color:var(--text); transform:translateY(-2px); }
.block-chip b{ font-size:12px; color:var(--muted); font-weight:900; }
.block-chip .dot{ width:9px; height:9px; border-radius:50%; flex:0 0 auto; }

/* ---------- QUIZ ---------- */
.quiz-top{ display:flex; align-items:center; gap:14px; margin-bottom:20px; }
.quiz-top .icon-btn{ width:38px; height:38px; font-size:16px; }
.progress{
  flex:1; height:16px; border-radius:999px; background:var(--bg-3); overflow:hidden;
  border:2px solid var(--border); position:relative;
}
.progress-fill{
  height:100%; width:0%; border-radius:999px;
  background:linear-gradient(90deg,var(--green),#8ee000);
  transition:width .5s var(--ease);
  position:relative; overflow:hidden;
}
.progress-fill::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.5),transparent);
  animation:sweep 2.2s linear infinite;
}
.quiz-score{
  display:flex; align-items:center; gap:6px; font-weight:900; font-size:14px; color:var(--orange);
  background:var(--yellow-s); padding:7px 12px; border-radius:12px; white-space:nowrap;
}
.quiz-count{ font-size:12.5px; font-weight:900; color:var(--muted); white-space:nowrap; }

.qcard{
  background:var(--card); border:2px solid var(--border); border-radius:var(--radius);
  padding:clamp(20px,3.4vw,34px); box-shadow:var(--shadow);
  animation:popIn .35s var(--ease) both;
}
.qmeta{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.qtext{
  font-size:clamp(19px,2.6vw,25px); font-weight:800; letter-spacing:-.02em; line-height:1.35;
}
.qsub{ margin-top:8px; font-size:13px; color:var(--muted); font-weight:700; }

.options{ display:grid; gap:11px; margin-top:22px; }
.opt{
  display:flex; align-items:center; gap:14px; text-align:left;
  padding:15px 18px; border-radius:16px; cursor:pointer;
  background:var(--card-2); color:var(--text);
  border:2px solid var(--border); border-bottom-width:4px;
  font-size:15px; font-weight:700; line-height:1.35;
  transition:transform .12s var(--ease), border-color .16s, background .16s, box-shadow .16s, opacity .3s;
  animation:fadeUp .35s var(--ease) both;
}
.opt:nth-child(1){ animation-delay:.03s; }
.opt:nth-child(2){ animation-delay:.07s; }
.opt:nth-child(3){ animation-delay:.11s; }
.opt:nth-child(4){ animation-delay:.15s; }
.opt:hover:not(.locked){ border-color:var(--blue); background:var(--blue-s); transform:translateY(-2px); }
.opt:active:not(.locked){ transform:translateY(1px); }
.opt-key{
  flex:0 0 auto; width:32px; height:32px; border-radius:10px; display:grid; place-items:center;
  font-size:13px; font-weight:900; color:var(--muted);
  background:var(--bg-3); border:2px solid var(--border);
  transition:all .18s var(--ease);
}
.opt.is-selected{ border-color:var(--blue); background:var(--blue-s); }
.opt.is-selected .opt-key{ background:var(--blue); color:#fff; border-color:var(--blue-d); }
.opt.locked{ cursor:default; }
.opt.is-correct{ border-color:var(--green); background:var(--green-s); animation:pop .35s var(--ease); }
.opt.is-correct .opt-key{ background:var(--green); color:#fff; border-color:var(--green-d); }
.opt.is-wrong{ border-color:var(--red); background:var(--red-s); animation:shake .45s var(--ease); }
.opt.is-wrong .opt-key{ background:var(--red); color:#fff; border-color:var(--red-d); }
.opt.is-dim{ opacity:.32; filter:grayscale(.6); }
.opt .mark{ margin-left:auto; font-size:18px; }

.qactions{ display:flex; flex-wrap:wrap; gap:9px; margin-top:18px; }
.qsubmit{ margin-top:20px; }
.chip-btn{
  display:inline-flex; align-items:center; gap:7px;
  padding:9px 15px; border-radius:999px; cursor:pointer;
  background:var(--card-2); border:2px solid var(--border);
  font-size:13px; font-weight:900; color:var(--text-2);
  transition:all .16s var(--ease);
}
.chip-btn:hover:not(:disabled){ border-color:var(--yellow); background:var(--yellow-s); color:var(--yellow-d); }
.chip-btn:disabled{ opacity:.4; cursor:not-allowed; }

.hintbox{
  margin-top:16px; padding:14px 16px; border-radius:14px;
  background:var(--yellow-s); border:2px dashed var(--yellow);
  font-size:14px; font-weight:700; color:var(--text-2);
  animation:slideDown .3s var(--ease) both;
}
.hintbox b{ color:var(--yellow-d); }

/* ---------- feedback ---------- */
.feedback{
  margin-top:18px; border-radius:var(--radius); padding:clamp(18px,3vw,26px);
  border:2px solid var(--border); background:var(--card); box-shadow:var(--shadow-sm);
  animation:slideUp .4s var(--ease) both;
}
.feedback.ok{ border-color:var(--green); background:linear-gradient(180deg,var(--green-s),var(--card) 70%); }
.feedback.bad{ border-color:var(--red); background:linear-gradient(180deg,var(--red-s),var(--card) 70%); }
.fb-head{ display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.fb-ico{
  width:44px; height:44px; border-radius:14px; display:grid; place-items:center; font-size:22px;
  background:var(--card); border:2px solid var(--border);
}
.feedback.ok .fb-ico{ border-color:var(--green); }
.feedback.bad .fb-ico{ border-color:var(--red); }
.fb-title{ font-size:18px; font-weight:900; }
.feedback.ok .fb-title{ color:var(--green-d); }
.feedback.bad .fb-title{ color:var(--red-d); }
.fb-answer{
  margin-top:6px; font-size:15.5px; font-weight:900; color:var(--text);
  padding:12px 14px; border-radius:12px; background:var(--card-2); border:2px solid var(--border);
}
.fb-answer small{ display:block; font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:900; margin-bottom:3px; }
.fb-text{ margin-top:12px; font-size:14.5px; font-weight:600; color:var(--text-2); }
.fb-ref{
  display:inline-flex; align-items:center; gap:7px; margin-top:12px;
  font-size:12.5px; font-weight:900; color:var(--blue-d);
  background:var(--blue-s); padding:6px 12px; border-radius:999px;
}
.fb-actions{ display:flex; gap:10px; margin-top:18px; flex-wrap:wrap; }
.fb-actions .btn{ flex:1; min-width:160px; }

/* ---------- RESULTADOS ---------- */
.result{ text-align:center; padding:10px 0; }
.result-emoji{ font-size:70px; animation:pop .6s var(--ease) both; }
.result h1{ font-size:clamp(28px,6vw,40px); font-weight:900; margin-top:8px; }
.result .sub{ color:var(--muted); font-weight:700; margin-top:6px; }
.ring-wrap{ display:grid; place-items:center; margin:26px auto 8px; position:relative; width:200px; height:200px; }
.ring-wrap svg{ transform:rotate(-90deg); }
.ring-bg{ fill:none; stroke:var(--bg-3); stroke-width:14; }
.ring-val{ fill:none; stroke:url(#ringGrad); stroke-width:14; stroke-linecap:round; transition:stroke-dashoffset 1s var(--ease); }
.ring-label{ position:absolute; inset:0; display:grid; place-content:center; text-align:center; }
.ring-label b{ font-size:38px; font-weight:900; letter-spacing:-.04em; display:block; line-height:1; }
.ring-label span{ font-size:12px; font-weight:900; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; }
.result-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:24px 0; }
.result-actions{ display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin-top:8px; }

.miss-list{ display:grid; gap:10px; }
.miss{
  display:flex; gap:12px; align-items:flex-start; padding:14px 16px;
  border-radius:14px; background:var(--card); border:2px solid var(--border);
  text-align:left;
}
.miss-n{
  flex:0 0 auto; width:26px; height:26px; border-radius:8px; display:grid; place-items:center;
  background:var(--red-s); color:var(--red-d); font-weight:900; font-size:12px;
}
.miss p{ font-size:13.5px; font-weight:700; color:var(--text-2); }
.miss b{ color:var(--text); font-weight:900; }

/* ---------- DASHBOARD ---------- */
.kpis{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.kpi{ padding:16px; border-radius:18px; background:var(--card); border:2px solid var(--border); box-shadow:var(--shadow-sm); }
.kpi-top{ display:flex; align-items:center; justify-content:space-between; }
.kpi-ico{ font-size:20px; }
.kpi-trend{ font-size:11px; font-weight:900; color:var(--green-d); background:var(--green-s); padding:2px 8px; border-radius:99px; }
.kpi-val{ font-size:28px; font-weight:900; letter-spacing:-.04em; margin-top:8px; line-height:1; }
.kpi-lbl{ font-size:11.5px; font-weight:800; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-top:4px; }

.dash-grid{ display:grid; grid-template-columns:1.05fr .95fr; gap:16px; margin-top:16px; }
.panel{ padding:20px; border-radius:var(--radius); background:var(--card); border:2px solid var(--border); box-shadow:var(--shadow-sm); }
.panel h3{ font-size:15px; font-weight:900; display:flex; align-items:center; gap:8px; margin-bottom:4px; }
.panel .panel-sub{ font-size:12.5px; color:var(--muted); font-weight:700; margin-bottom:14px; }

.donut-wrap{ display:flex; align-items:center; gap:22px; }
.donut{ width:150px; height:150px; flex:0 0 auto; }
.donut circle{ transition:stroke-dashoffset 1s var(--ease); }
.legend{ display:grid; gap:10px; font-size:13px; font-weight:800; color:var(--text-2); }
.legend span{ display:flex; align-items:center; gap:8px; }
.legend i{ width:11px; height:11px; border-radius:3px; display:inline-block; }
.legend b{ margin-left:auto; color:var(--text); font-weight:900; }

.bars{ display:grid; gap:11px; max-height:330px; overflow:auto; padding-right:4px; }
.bar-row{ display:grid; grid-template-columns:1fr auto; gap:6px 10px; align-items:center; }
.bar-name{ font-size:12.5px; font-weight:800; color:var(--text-2); }
.bar-val{ font-size:12px; font-weight:900; color:var(--muted); }
.bar-track{ grid-column:1 / -1; height:10px; border-radius:99px; background:var(--bg-3); overflow:hidden; }
.bar-fill{ height:100%; border-radius:99px; width:0; transition:width .9s var(--ease); }

.hard-list{ display:grid; gap:9px; max-height:340px; overflow:auto; padding-right:4px; }
.hard-item{
  display:flex; gap:10px; align-items:center; padding:11px 13px; border-radius:12px;
  background:var(--card-2); border:2px solid var(--border); cursor:pointer;
  transition:all .16s var(--ease);
}
.hard-item:hover{ border-color:var(--red); transform:translateX(3px); }
.hard-item .txt{ flex:1; min-width:0; }
.hard-item .txt p{ font-size:12.8px; font-weight:800; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hard-item .txt small{ font-size:11px; color:var(--muted); font-weight:800; }
.hard-bad{
  flex:0 0 auto; font-size:11px; font-weight:900; padding:4px 9px; border-radius:99px;
  background:var(--red-s); color:var(--red-d);
}

.spark{ width:100%; height:90px; }
.spark polyline{ fill:none; stroke:url(#sparkGrad); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.spark .area{ fill:url(#sparkArea); stroke:none; }

.history{ display:grid; gap:8px; margin-top:6px; max-height:190px; overflow:auto; }
.hist-row{ display:flex; align-items:center; gap:10px; font-size:12.5px; font-weight:800; color:var(--text-2); }
.hist-row i{ width:8px; height:8px; border-radius:99px; background:var(--green); }
.hist-row span:last-child{ margin-left:auto; color:var(--muted); }

.dash-actions{ display:flex; flex-wrap:wrap; gap:10px; margin-top:18px; }

.empty{
  text-align:center; padding:34px 20px; color:var(--muted); font-weight:700;
}
.empty .big{ font-size:40px; display:block; margin-bottom:8px; }

/* ---------- toast / modal / confetti ---------- */
.toast{
  position:fixed; left:50%; bottom:26px; transform:translate(-50%,140%);
  background:var(--text); color:var(--bg); padding:12px 20px; border-radius:14px;
  font-weight:800; font-size:14px; z-index:80; box-shadow:var(--shadow-lg);
  transition:transform .4s var(--ease), visibility .4s; pointer-events:none;
  max-width:90vw; text-align:center; visibility:hidden;
}
.toast.show{ transform:translate(-50%,0); visibility:visible; }

.confetti{ position:fixed; inset:0; width:100%; height:100%; pointer-events:none; z-index:90; display:none; }

.modal-back{
  position:fixed; inset:0; z-index:100; display:grid; place-items:center; padding:20px;
  background:rgba(12,20,34,.5); backdrop-filter:blur(4px);
  animation:fadeIn .2s var(--ease) both;
}
.modal{
  width:100%; max-width:420px; background:var(--card); border-radius:22px; padding:26px;
  box-shadow:var(--shadow-lg); border:2px solid var(--border);
  animation:popIn .28s var(--ease) both; text-align:center;
}
.modal h3{ font-size:20px; font-weight:900; margin-bottom:8px; }
.modal p{ font-size:14px; color:var(--text-2); font-weight:700; }
.modal-actions{ display:flex; gap:10px; margin-top:20px; }
.modal-actions .btn{ flex:1; }

/* ---------- footer ---------- */
.footer{
  position:relative; z-index:1; text-align:center; padding:26px 20px 40px;
  font-size:12px; color:var(--muted); font-weight:700;
}
.footer p + p{ margin-top:6px; }
.credit{
  font-size:13.5px; font-weight:900; color:var(--text-2); letter-spacing:.01em;
}
.heart{
  display:inline-block; font-size:16px; line-height:1;
  filter:drop-shadow(0 0 6px rgba(255,200,0,.75));
  animation:heartbeat 2.2s var(--ease) infinite;
}
@keyframes heartbeat{
  0%, 100%{ transform:scale(1); }
  12%{ transform:scale(1.22); }
  24%{ transform:scale(1); }
  36%{ transform:scale(1.14); }
  48%{ transform:scale(1); }
}

/* ---------- animaciones ---------- */
@keyframes fadeIn{ from{opacity:0} to{opacity:1} }
@keyframes fadeUp{ from{opacity:0; transform:translateY(14px)} to{opacity:1; transform:none} }
@keyframes slideUp{ from{opacity:0; transform:translateY(22px)} to{opacity:1; transform:none} }
@keyframes slideDown{ from{opacity:0; transform:translateY(-8px)} to{opacity:1; transform:none} }
@keyframes popIn{ from{opacity:0; transform:scale(.96)} to{opacity:1; transform:scale(1)} }
@keyframes pop{ 0%{transform:scale(1)} 45%{transform:scale(1.035)} 100%{transform:scale(1)} }
@keyframes bob{ 0%,100%{transform:translateY(0) rotate(-2deg)} 50%{transform:translateY(-7px) rotate(2deg)} }
@keyframes float{ 0%,100%{transform:translate3d(0,0,0) scale(1)} 50%{transform:translate3d(24px,-30px,0) scale(1.08)} }
@keyframes shine{ to{ background-position:200% center } }
@keyframes sweep{ from{transform:translateX(-100%)} to{transform:translateX(200%)} }
@keyframes shake{
  10%,90%{transform:translateX(-2px)} 20%,80%{transform:translateX(4px)}
  30%,50%,70%{transform:translateX(-6px)} 40%,60%{transform:translateX(6px)}
}
@keyframes xpFloat{ from{opacity:1; transform:translateY(0) scale(1)} to{opacity:0; transform:translateY(-40px) scale(1.25)} }

.xp-float{
  position:fixed; z-index:70; font-weight:900; font-size:18px; color:var(--green-d);
  pointer-events:none; animation:xpFloat .9s var(--ease) forwards;
}

/* ---------- base táctil ---------- */
html{ -webkit-text-size-adjust:100%; }
body{ -webkit-tap-highlight-color:transparent; min-height:100dvh; }
.btn, .opt, .mode, .block-chip, .chip-btn, .icon-btn, .hard-item, .nav a{ touch-action:manipulation; }

/* ---------- responsive: móviles medianos como caso principal ---------- */
@media (max-width:860px){
  .strip{ grid-template-columns:repeat(2,1fr); }
  .kpis{ grid-template-columns:repeat(2,1fr); }
  .dash-grid{ grid-template-columns:1fr; }
  .blocks{ grid-template-columns:repeat(2,1fr); }
  .modes{ grid-template-columns:1fr; }
}

@media (max-width:700px){
  main{ padding:16px 14px calc(100px + env(safe-area-inset-bottom, 0px)); }

  .topbar{ gap:10px; padding:8px 14px; backdrop-filter:none; -webkit-backdrop-filter:none; }
  .brand-mark{ width:40px; height:40px; font-size:23px; border-radius:12px; box-shadow:0 3px 0 var(--green-d); }
  .brand-text strong{ font-size:16.5px; }
  .brand-text small{ display:none; }
  .icon-btn{ width:44px; height:44px; }

  .hero{ padding:22px 16px 20px; border-radius:22px; }
  .hero-emoji{ font-size:46px; margin-bottom:2px; }
  .hero h1{ font-size:clamp(32px,10.5vw,44px); }
  .hero p.lead{ font-size:14.8px; margin-top:10px; line-height:1.5; }
  .hero-badges{ margin-top:14px; gap:6px; }
  .hero-badges span{ font-size:11.5px; padding:5px 11px; }

  .strip{ margin:18px 0 22px; gap:10px; }
  .stat{ padding:12px 10px; border-radius:14px; }
  .stat-ico{ font-size:17px; }
  .stat-val{ font-size:21px; }
  .stat-lbl{ font-size:10px; letter-spacing:.04em; }

  .section{ margin-top:26px; }
  .section-title{ font-size:18.5px; gap:8px; }
  .section-title::before{ height:20px; width:7px; }
  .section-sub{ font-size:12px; }

  .modes{ gap:10px; }
  .mode{ padding:14px; gap:12px; border-radius:16px; }
  .mode-ico{ width:46px; height:46px; font-size:21px; border-radius:13px; }
  .mode-body h3{ font-size:15px; }
  .mode-body p{ font-size:12.5px; }
  .mode-tag{ margin-top:7px; font-size:10px; }

  .blocks{ gap:8px; }
  .block-chip{ padding:11px 12px; font-size:12.3px; border-radius:12px; }
  .block-chip b{ font-size:11px; }

  .btn-lg{ padding:16px 22px; font-size:16px; border-radius:16px; }

  /* ---- quiz ---- */
  .quiz-top{ gap:8px; margin-bottom:14px; }
  .quiz-top .icon-btn{ width:36px; height:36px; }
  .progress{ height:14px; }
  .quiz-count{ font-size:11.5px; }
  .quiz-score{ font-size:13px; padding:6px 10px; }

  .qcard{ padding:16px 14px; border-radius:18px; }
  .qmeta{ gap:6px; margin-bottom:12px; }
  .qmeta .pill{ font-size:10.5px; padding:4px 10px; }
  .qtext{ font-size:18.5px; line-height:1.32; }

  .options{ gap:9px; margin-top:16px; }
  .opt{ min-height:58px; padding:13px 14px; font-size:14.6px; gap:11px; border-radius:14px; }
  .opt-key{ width:30px; height:30px; font-size:12px; border-radius:9px; }

  .qactions{ gap:8px; margin-top:14px; }
  .chip-btn{ padding:9px 13px; font-size:12.5px; }
  .keys-hint{ display:none; }

  /* barra de acción siempre en el pulgar */
  .qsubmit{
    position:sticky; bottom:0; z-index:6;
    margin:16px -14px -16px; padding:10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background:linear-gradient(180deg, rgba(0,0,0,0), var(--card) 45%);
  }
  .in-quiz .nav{ display:none; }
  .in-quiz main{ padding-bottom:24px; }

  /* ---- feedback ---- */
  .feedback{ padding:16px 14px; border-radius:18px; }
  .fb-ico{ width:38px; height:38px; font-size:19px; border-radius:12px; }
  .fb-title{ font-size:16.5px; }
  .fb-answer{ font-size:14.5px; padding:11px 12px; }
  .fb-text{ font-size:13.8px; }
  .fb-ref{ font-size:11.5px; }
  .fb-actions{ margin-top:14px; }
  .fb-actions .btn{ min-width:0; }

  /* ---- resultados ---- */
  .result-emoji{ font-size:58px; }
  .ring-wrap, .ring-wrap svg{ width:172px; height:172px; }
  .ring-label b{ font-size:34px; }
  .result-grid{ grid-template-columns:repeat(3,1fr); gap:8px; }
  .result-actions{ flex-direction:column; }
  .result-actions .btn{ width:100%; }

  /* ---- dashboard ---- */
  .kpis{ gap:10px; }
  .kpi{ padding:14px; border-radius:16px; }
  .kpi-val{ font-size:24px; }
  .kpi-lbl{ font-size:10.5px; }
  .dash-grid{ gap:12px; }
  .panel{ padding:16px; border-radius:18px; }
  .donut{ width:132px; height:132px; }
  .donut-wrap{ flex-direction:column; align-items:flex-start; gap:16px; }
  .dash-actions{ gap:8px; }
  .dash-actions .btn{ flex:1 1 44%; }

  /* ---- navegación inferior ---- */
  .nav{
    position:fixed; left:0; right:0; bottom:0; z-index:50;
    display:flex; justify-content:space-around; gap:2px;
    padding:7px 8px calc(7px + env(safe-area-inset-bottom, 0px));
    background:var(--card); border-top:2px solid var(--border);
    box-shadow:0 -8px 24px rgba(23,40,77,.07);
  }
  .nav a{ flex:1; text-align:center; padding:10px 6px; font-size:12px; border-radius:14px; }
  .nav-ico{ display:inline; margin-right:4px; }

  .footer{ padding-bottom:96px; font-size:11px; }
  .toast{ bottom:calc(86px + env(safe-area-inset-bottom, 0px)); }
}

/* iPhone SE / pantallas angostas */
@media (max-width:380px){
  .hero h1{ font-size:31px; }
  .hero p.lead{ font-size:14px; }
  .qtext{ font-size:17.4px; }
  .opt{ font-size:14px; padding:12px 12px; }
  .stat-val{ font-size:19px; }
  .blocks{ grid-template-columns:1fr; }
  .result-grid{ grid-template-columns:1fr 1fr; }
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
}
