/* Estilos comunes a todos los mundos: colores, encabezado, tarjetas, paneles, botones, tablas,
   retroalimentación, ventanas, pantalla de resultado y confeti. */
:root {
  --navy: #1B1F3B; --ink: #22263F; --gray: #6B7280; --light: #F1F3F9; --off: #C9CDD8;
  --yellow: #FFC93C; --cyan: #22B8CF; --pink: #EF476F; --green: #2BB673; --orange: #FF8C42; --purple: #7B61FF;
  --red: #E5383B; --teal: #0E7C86;
  --font: "Arial Rounded MT Bold", "Nunito", ui-rounded, "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--light); min-height: 100vh; }
button { font-family: inherit; cursor: pointer; }
header {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--navy); color: white;
}
header h1 { font-size: 22px; margin: 0; flex: 1; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.blocks { display: inline-grid; grid-template-columns: repeat(3, 9px); gap: 2px; }
.blocks i { width: 9px; height: 9px; border-radius: 2px; background: var(--yellow); }
.blocks i:nth-child(4) { grid-column: 2; }
.hbtn {
  background: rgba(255,255,255,.12); color: white; border: 0; border-radius: 12px; padding: 8px 14px; font-size: 16px;
  text-decoration: none; font-family: inherit;
}
.hbtn:hover { background: rgba(255,255,255,.22); }
main { max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; }

.home-title { text-align: center; margin: 8px 0 24px; }
.home-title h2 { font-size: 34px; margin: 0 0 6px; }
.home-title p { color: var(--gray); font-size: 18px; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 18px; }
.card {
  background: white; border-radius: 20px; padding: 22px; border: 0; text-align: left; font-size: 16px; color: var(--ink);
  box-shadow: 0 4px 14px rgba(27,31,59,.08); transition: transform .12s; text-decoration: none;
}
button.card, a.card { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; }
button.card:hover, a.card:hover { transform: translateY(-3px); }
.card h3 { margin: 10px 0 6px; font-size: 24px; }
.card p { margin: 0; color: var(--gray); line-height: 1.35; }
.card .badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px; color: white; font-size: 14px;
}
.stars { font-size: 22px; letter-spacing: 2px; margin-top: 10px; color: var(--yellow); }
.stars .empty { color: var(--off); }
.setting { margin: 22px auto 0; text-align: center; font-size: 17px; color: var(--gray); }
.setting input { width: 20px; height: 20px; vertical-align: -3px; margin-right: 6px; }

.panel { background: white; border-radius: 22px; padding: 18px 20px 24px; box-shadow: 0 4px 14px rgba(27,31,59,.08); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: 24px; }
.progress { display: flex; gap: 6px; }
.progress span { width: 16px; height: 16px; border-radius: 4px; background: var(--off); }
.progress span.ok { background: var(--green); }
.progress span.bad { background: var(--pink); }
.progress span.now { outline: 3px solid var(--yellow); outline-offset: 1px; }
.question { font-size: 21px; text-align: center; margin: 6px 0 4px; }
.hint { font-size: 15px; color: var(--gray); text-align: center; margin: 0 0 6px; }

.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.lab { display: flex; align-items: center; justify-content: center; gap: 10px 24px; flex-wrap: wrap; }
.lab-view { flex: 1 1 360px; min-width: 0; max-width: 600px; }
.reveal { animation: reveal .6s ease-out; }
@keyframes reveal { from { opacity: 0; transform: scale(.9); } }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; margin: 16px 0 6px; }
.choice {
  background: white; border: 3px solid var(--off); border-radius: 18px; padding: 8px 6px; font-size: 18px; color: var(--ink);
  box-shadow: 0 4px 0 rgba(0,0,0,.08); transition: transform .08s;
}
.choice:hover:not(:disabled) { border-color: var(--yellow); transform: translateY(-2px); }
.choice:disabled { cursor: default; }
.choice.wrong { border-color: var(--red); opacity: .45; }
.choice.right { border-color: var(--green); background: #E6F7EE; }

.feedback { min-height: 64px; text-align: center; font-size: 20px; margin-top: 10px; }
.feedback.good { color: var(--green); }
.feedback.bad { color: var(--pink); }
.feedback small { display: block; color: var(--ink); font-size: 17px; margin-top: 6px; }
.actions { display: flex; justify-content: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.btn {
  border: 0; border-radius: 16px; padding: 14px 26px; font-size: 20px; color: white; background: var(--navy);
  box-shadow: 0 4px 0 rgba(0,0,0,.2);
}
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: white; color: var(--ink); box-shadow: inset 0 0 0 2px var(--off); }
.btn:disabled { opacity: .45; cursor: default; }

table.tt { border-collapse: separate; border-spacing: 3px; margin: 8px auto 0; font-size: 18px; }
table.tt th { background: var(--navy); color: white; padding: 4px 14px; border-radius: 6px; font-weight: normal; }
table.tt td { text-align: center; padding: 4px 14px; border-radius: 6px; background: var(--off); color: var(--ink); }
table.tt td.b1 { background: var(--green); color: white; }
.feedback table.tt { font-size: 17px; }
table.tt tr.hl td { outline: 3px solid var(--yellow); }
table.tt td.mark { background: none; padding: 4px 2px; font-size: 20px; }
table.tt tr.hl td.mark { outline: none; }
table.tt td.mark.ok { color: var(--green); }
table.tt td.mark.no { color: var(--red); }
.sum { font-size: 30px; text-align: center; margin: 4px 0 10px; }
.goal { font-size: 20px; text-align: center; color: var(--gray); }
.goal b { font-size: 30px; color: var(--ink); }

.modal-bg {
  position: fixed; inset: 0; background: rgba(27,31,59,.55); display: flex; align-items: center; justify-content: center; z-index: 10;
}
.modal { background: white; border-radius: 22px; padding: 22px 28px; max-width: 360px; text-align: center; }
.modal h3 { margin: 0 0 4px; font-size: 26px; }
.modal p { font-size: 18px; margin: 6px 0; }

.result { text-align: center; padding: 20px 10px; }
.result .big-stars { font-size: 64px; letter-spacing: 8px; color: var(--yellow); }
.result .big-stars .empty { color: var(--off); }
.result h2 { font-size: 32px; margin: 10px 0 4px; }
.result p { font-size: 20px; color: var(--gray); margin: 0 0 16px; }

.confetti { position: fixed; top: -20px; width: 12px; height: 12px; border-radius: 3px; z-index: 20; pointer-events: none;
  animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); } }
