:root{
  --purple:#75539c;
  --purple-dark:#51376f;
  --lavender:#eee8f7;
  --blue:#dfeff7;
  --mint:#e4f4ec;
  --peach:#faeadf;
  --yellow:#fff4c9;
  --ink:#302b39;
  --muted:#70697a;
  --white:#ffffff;
  --line:#e9e4ee;
  --shadow:0 16px 40px rgba(71,50,94,.10);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:Inter,ui-rounded,"Arial Rounded MT Bold",Nunito,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink);
  background:
    radial-gradient(circle at 10% 0%,rgba(238,232,247,.95),transparent 34%),
    radial-gradient(circle at 100% 22%,rgba(223,239,247,.72),transparent 28%),
    #fbfafc;
}
button{font:inherit}
.page-shell{max-width:1240px;margin:0 auto;padding:24px 22px 42px}
.hero{
  position:relative;overflow:hidden;
  min-height:190px;padding:26px 32px;border-radius:30px;
  background:linear-gradient(135deg,#f4effb 0%,#fff 47%,#edf7fb 100%);
  border:1px solid rgba(117,83,156,.10);box-shadow:var(--shadow);
}
.brand-row{display:flex;align-items:center;gap:24px;position:relative;z-index:2}
.logo-box{width:185px;min-width:185px;height:120px;display:flex;align-items:center;justify-content:center;background:#fff;border-radius:22px;padding:12px;box-shadow:0 10px 28px rgba(57,42,70,.08)}
.school-logo{width:100%;height:100%;object-fit:contain}
.logo-fallback{display:none;place-items:center;text-align:center;font-weight:900;line-height:1.05;color:var(--purple);font-size:22px}
.brand-copy .eyebrow,.section-kicker,.panel-kicker{letter-spacing:.12em;font-weight:900;color:var(--purple);font-size:12px;margin:0 0 5px}
h1{font-size:clamp(34px,5vw,58px);line-height:1;margin:4px 0 10px;color:var(--purple-dark);letter-spacing:-.035em}
.brand-copy>p:last-child{margin:0;font-size:17px;color:var(--muted)}
.hero-bubbles{position:absolute;right:28px;top:24px;width:235px;height:145px;opacity:.82}
.hero-bubbles span{position:absolute;display:grid;place-items:center;border-radius:50%;font-weight:900;color:var(--purple-dark);box-shadow:0 8px 24px rgba(57,42,70,.08)}
.hero-bubbles span:nth-child(1){width:54px;height:54px;background:var(--yellow);right:96px;top:4px;transform:rotate(-8deg)}
.hero-bubbles span:nth-child(2){width:44px;height:44px;background:var(--mint);right:28px;top:44px;transform:rotate(7deg)}
.hero-bubbles span:nth-child(3){width:47px;height:47px;background:var(--peach);right:132px;top:82px;transform:rotate(9deg)}
.hero-bubbles span:nth-child(4){width:60px;height:60px;background:var(--blue);right:58px;top:88px;transform:rotate(-5deg)}
.tabs{display:flex;gap:9px;overflow-x:auto;padding:18px 3px 8px;scrollbar-width:thin}
.tab-btn{border:1px solid var(--line);background:rgba(255,255,255,.86);color:#655d6f;border-radius:999px;padding:10px 15px;font-weight:850;white-space:nowrap;cursor:pointer;transition:.18s ease}
.tab-btn:hover{transform:translateY(-1px);border-color:#d8cde4}
.tab-btn.active{background:var(--purple);border-color:var(--purple);color:#fff;box-shadow:0 8px 18px rgba(117,83,156,.24)}
main{padding-top:9px}
.control-card{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:22px 24px;background:#fff;border:1px solid var(--line);border-radius:24px;box-shadow:0 10px 28px rgba(60,43,79,.06)}
.control-card h2{font-size:25px;margin:0 0 6px}
.help-text{margin:0;color:var(--muted);max-width:720px;line-height:1.45}
.actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.btn{border:none;border-radius:15px;padding:12px 16px;font-weight:850;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease}
.btn:hover{transform:translateY(-2px)}
.btn-primary{background:var(--purple);color:#fff;box-shadow:0 9px 20px rgba(117,83,156,.2)}
.btn-secondary{background:var(--mint);color:#285e49}
.btn-pdf{background:var(--peach);color:#7b4b2e}
.workspace-grid{display:grid;grid-template-columns:1.13fr .87fr;gap:18px;margin-top:18px}
.panel{min-height:430px;background:#fff;border:1px solid var(--line);border-radius:24px;padding:23px;box-shadow:0 10px 28px rgba(60,43,79,.06)}
.panel-heading{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #f0ecf3;padding-bottom:14px;margin-bottom:17px}
.panel-heading h3{margin:0;font-size:22px}
.count-chip,.dictation-chip{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;font-weight:900;font-size:12px;padding:7px 10px;background:var(--lavender);color:var(--purple-dark)}
.count-chip{min-width:34px}
.exercise-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.exercise-item{position:relative;display:flex;align-items:center;min-height:62px;border:1px solid #eee9f2;background:#fdfcfe;border-radius:16px;padding:12px 14px 12px 44px;font-size:18px;font-weight:760;line-height:1.35}
.exercise-number{position:absolute;left:13px;top:50%;transform:translateY(-50%);width:23px;height:23px;border-radius:50%;display:grid;place-items:center;background:var(--lavender);color:var(--purple-dark);font-size:12px;font-weight:900}
.blank{display:inline-block;min-width:42px;border-bottom:3px solid var(--purple);height:1.05em;vertical-align:-.08em;margin:0 3px}
.options{font-size:12px;font-weight:900;color:#82788c;margin-left:auto;padding-left:8px;white-space:nowrap}
.empty-state{min-height:300px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--muted);gap:7px;padding:30px}
.empty-state strong{color:var(--ink);font-size:18px}.empty-state span{max-width:350px;line-height:1.5}.empty-icon{font-size:36px}
.dictation-text{font-family:Georgia,"Times New Roman",serif;font-size:21px;line-height:1.9;background:linear-gradient(#fff,#fff) padding-box,repeating-linear-gradient(to bottom,transparent 0,transparent 39px,#eee8f3 40px) border-box;padding:4px 4px;white-space:pre-line}
.hidden{display:none}
.tip-card{display:flex;gap:13px;align-items:flex-start;margin-top:18px;padding:17px 20px;background:var(--yellow);border:1px solid #f2e6ad;border-radius:20px;color:#625629}
.tip-card p{margin:4px 0 0;line-height:1.45}.tip-icon{font-size:25px}
footer{display:flex;justify-content:center;gap:7px;padding-top:28px;color:#978f9e;font-size:13px;font-weight:700}
@media(max-width:900px){.workspace-grid{grid-template-columns:1fr}.control-card{align-items:flex-start;flex-direction:column}.actions{justify-content:flex-start}.hero-bubbles{opacity:.4}.brand-row{gap:15px}.logo-box{width:145px;min-width:145px;height:100px}}
@media(max-width:620px){.page-shell{padding:12px}.hero{padding:20px;border-radius:22px}.brand-row{align-items:flex-start;flex-direction:column}.logo-box{width:160px;height:92px}.hero-bubbles{right:5px;top:15px;transform:scale(.78)}h1{font-size:35px}.exercise-list{grid-template-columns:1fr}.panel{padding:18px}.actions{display:grid;width:100%;grid-template-columns:1fr}.btn{width:100%}.control-card{padding:19px}.tabs{padding-top:14px}}
@media print{body{background:#fff}.hero,.tabs,.control-card,.tip-card,footer{display:none}.page-shell{max-width:none;padding:0}.workspace-grid{display:block}.panel{box-shadow:none;border:none;padding:0;min-height:auto}.dictation-panel{margin-top:28px}.exercise-item{break-inside:avoid}.panel-heading{margin-bottom:12px}}


/* Gamificación */
.progress-card{display:grid;grid-template-columns:auto 1fr auto;gap:18px;align-items:center;margin:10px 0 8px;padding:16px 18px;background:rgba(255,255,255,.9);border:1px solid var(--line);border-radius:22px;box-shadow:0 10px 28px rgba(60,43,79,.05)}
.progress-main{display:flex;gap:10px;flex-wrap:wrap}.progress-badge{display:flex;align-items:center;gap:9px;min-width:118px;padding:9px 12px;border-radius:16px;background:var(--lavender)}
.progress-badge:nth-child(2){background:var(--peach)}.progress-badge:nth-child(3){background:var(--yellow)}.progress-icon{font-size:23px}.progress-badge small{display:block;font-size:9px;letter-spacing:.08em;color:var(--muted);font-weight:900}.progress-badge strong{display:block;font-size:22px;line-height:1;color:var(--purple-dark);margin-top:3px}
.progress-copy{display:flex;flex-direction:column;gap:3px;min-width:220px}.progress-copy strong{font-size:14px}.progress-copy span{font-size:12px;color:var(--muted);line-height:1.35}.reset-progress{border:0;background:transparent;color:#8b8292;font-weight:800;font-size:12px;cursor:pointer;padding:8px}.reset-progress:hover{color:var(--purple-dark)}
.btn-check{background:var(--blue);color:#28536a}.exercise-item{align-items:center;gap:5px}.exercise-word{min-width:0;flex:1}.exercise-word.word-exercise{white-space:nowrap}.answer-input{width:58px;min-width:48px;border:2px solid #d8cde4;border-radius:10px;background:#fff;padding:6px 7px;text-align:center;font-size:17px;font-weight:900;color:var(--purple-dark);text-transform:uppercase;outline:none;vertical-align:baseline;margin:0 3px}.answer-input:focus{border-color:#9571b0;box-shadow:0 0 0 3px rgba(117,83,156,.10)}.answer-input.correct{border-color:#72b891;background:#effaf4}.answer-input.incorrect{border-color:#de8a91;background:#fff3f4}.answer-input.pending{border-color:#e2c66f;background:#fff9e8}
.no-h-btn{border:1px solid #d8cde4;background:#fff;color:#6e6877;border-radius:9px;padding:6px 8px;font-size:10px;font-weight:900;cursor:pointer;white-space:nowrap}.no-h-btn.selected{border-color:var(--purple);background:var(--lavender);color:var(--purple-dark)}.feedback-mark{width:24px;min-width:24px;height:24px;display:grid;place-items:center;font-weight:950}.feedback-mark.pending{font-size:9px;color:#9b7b19}.options{margin-left:4px}.check-summary{margin-top:14px;padding:11px 13px;border-radius:13px;background:var(--lavender);font-size:13px;font-weight:750;color:var(--purple-dark);line-height:1.35}
.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,18px);z-index:1000;background:#33293d;color:#fff;padding:11px 16px;border-radius:999px;font-weight:850;font-size:13px;box-shadow:0 12px 30px rgba(30,20,40,.23);opacity:0;pointer-events:none;transition:.2s ease}.toast.show{opacity:1;transform:translate(-50%,0)}
.celebration{position:fixed;inset:0;z-index:999;display:grid;place-items:center;background:rgba(50,35,62,.18);backdrop-filter:blur(2px);opacity:0;pointer-events:none;transition:.18s ease;overflow:hidden}.celebration.show{opacity:1;pointer-events:auto}.celebration-card{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;gap:7px;min-width:260px;padding:28px 32px;border-radius:26px;background:#fff;box-shadow:0 20px 60px rgba(45,25,58,.24);text-align:center;transform:scale(.88);transition:.2s ease}.celebration.show .celebration-card{transform:scale(1)}.celebration-emoji{font-size:44px}.celebration-card strong{font-size:28px;color:var(--purple-dark)}.celebration-card span{color:var(--muted);font-weight:800}.spark{position:absolute;top:-50px;font-size:23px;animation:sparkFall 1.4s ease-in forwards;z-index:1}@keyframes sparkFall{0%{transform:translateY(-20px) rotate(0);opacity:0}15%{opacity:1}100%{transform:translateY(110vh) rotate(320deg);opacity:.2}}
@media(max-width:900px){.progress-card{grid-template-columns:1fr}.progress-copy{order:2}.reset-progress{justify-self:start}.progress-main{order:1}}
@media(max-width:620px){.progress-main{display:grid;grid-template-columns:repeat(3,1fr);width:100%}.progress-badge{min-width:0;padding:8px;gap:5px}.progress-icon{font-size:18px}.progress-badge strong{font-size:18px}.progress-badge small{font-size:7px}.answer-input{width:52px}.options{display:none}.exercise-item{font-size:17px;padding-right:10px}.progress-card{padding:13px}.celebration-card{min-width:230px;margin:18px}}
@media print{.progress-card,.toast,.celebration,#checkSummary{display:none!important}.answer-input,.no-h-btn,.feedback-mark{display:none!important}.exercise-word .print-blank{display:inline-block!important}}
