:root {
  --bg: #e0f2fe;
  /* light sky blue */
  --panel: #ffffff;
  --border: rgba(15, 23, 42, .08);
  --text: #1e293b;
  --muted: #64748b;

  --blue: #3b82f6;
  /* super vibrant */
  --blue-dark: #2563eb;
  --green: #22c55e;
  --green-dark: #16a34a;
  --red: #ef4444;
  --red-dark: #dc2626;
  --yellow: #facc15;
  --orange: #f97316;
  --purple: #a855f7;

  --radius: 28px;
  --radius-sm: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Baloo 2', cursive, system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, #bfdbfe 0%, transparent 40%),
    radial-gradient(circle at 85% 90%, #fef08a 0%, transparent 40%),
    radial-gradient(circle at 90% 20%, #fbcfe8 0%, transparent 40%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 4px solid rgba(255, 255, 255, .5);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .03);
  border-radius: 0 0 24px 24px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #3b82f6, #a855f7);
  box-shadow: 0 6px 0 #2563eb, 0 10px 15px rgba(37, 99, 235, .3);
  font-weight: 800;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  text-shadow: 0px 3px 0 rgba(0, 0, 0, .2);
}

.brandName {
  font-weight: 800;
  font-size: 22px;
  line-height: 1.1;
}

.brandSub {
  font-size: 15px;
  color: var(--muted);
  font-weight: 600;
}

.card {
  background: #ffffff;
  border: 4px solid #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 12px 0 rgba(0, 0, 0, .04), 0 20px 40px rgba(0, 0, 0, .06);
  margin-top: 16px;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 16px;
}

.heroText h1 {
  margin: 0 0 12px;
  font-size: 38px;
  line-height: 1.15;
  font-weight: 800;
  color: #1e293b;
}

.muted {
  color: var(--muted);
  font-size: 18px;
  font-weight: 500;
}

.note {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  border: 3px solid #fde68a;
  border-bottom-width: 6px;
  font-size: 16px;
  font-weight: 600;
  color: #92400e;
}

.heroCard {
  background: #f8fafc;
  border: 3px solid #e2e8f0;
  border-bottom-width: 6px;
  border-radius: var(--radius);
  padding: 20px;
}

.heroCardTitle {
  font-weight: 800;
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--blue);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

label {
  display: block;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}

select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  border: 3px solid #cbd5e1;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

select:focus {
  border-color: var(--blue);
}

.help {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
  font-weight: 500;
}

.divider {
  height: 3px;
  background: #e2e8f0;
  margin: 20px 0;
  border-radius: 10px;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.tile {
  text-align: left;
  padding: 20px;
  border-radius: var(--radius);
  border: 3px solid #e2e8f0;
  border-bottom-width: 8px;
  background: #fff;
  cursor: pointer;
  transition: all .1s cubic-bezier(0.4, 0, 0.2, 1);
}

.tile:hover {
  transform: translateY(-3px);
  border-bottom-width: 11px;
  margin-bottom: -3px;
}

.tile:active {
  transform: translateY(4px);
  border-bottom-width: 3px;
  margin-bottom: 5px;
}

.tile[data-subject="Español"] {
  border-color: #38bdf8;
}

.tile[data-subject="Español"]:hover {
  background: #f0f9ff;
}

.tile[data-subject="Matemáticas"] {
  border-color: #fbbf24;
}

.tile[data-subject="Matemáticas"]:hover {
  background: #fffbeb;
}

.tile[data-subject="Inglés"] {
  border-color: #f43f5e;
}

.tile[data-subject="Inglés"]:hover {
  background: #fff1f2;
}

.tile[data-subject="Ética"] {
  border-color: #4ade80;
}

.tile[data-subject="Ética"]:hover {
  background: #f0fdf4;
}

.tileIcon {
  font-size: 40px;
  line-height: 1;
}

.tileTitle {
  font-weight: 800;
  margin-top: 10px;
  font-size: 22px;
  color: #1e293b;
}

.tileSub {
  font-size: 15px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 600;
  line-height: 1.3;
}

.itemBtn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 3px solid #cbd5e1;
  border-bottom-width: 6px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 18px;
  font-family: inherit;
  color: #1e293b;
  transition: all .1s cubic-bezier(0.4, 0, 0.2, 1);
}

.itemBtn:hover {
  border-color: var(--blue);
  background: #f0f9ff;
  transform: translateY(-3px);
  border-bottom-width: 9px;
  margin-bottom: -3px;
}

.itemBtn:active {
  transform: translateY(4px);
  border-bottom-width: 3px;
  margin-bottom: 5px;
}

.itemTag {
  background: #e2e8f0;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 800;
  color: #475569;
}

.startRow {
  margin-top: 20px;
}

.micro {
  font-size: 14px;
  margin-top: 12px;
  font-weight: 500;
}

.btn {
  width: 100%;
  padding: 16px 20px;
  border-radius: 20px;
  border: 3px solid #cbd5e1;
  border-bottom-width: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  font-size: 20px;
  font-family: inherit;
  transition: all .1s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.btn:active {
  transform: translateY(5px);
  border-bottom-width: 3px;
  margin-bottom: 5px;
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
  border-bottom-width: 8px !important;
  margin-bottom: 0 !important;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue-dark);
}

.btn-primary:hover {
  background: #60a5fa;
}

.btn-secondary {
  background: var(--green);
  color: #fff;
  border-color: var(--green-dark);
}

.btn-secondary:hover {
  background: #4ade80;
}

.btn-ghost {
  width: auto;
  padding: 12px 18px;
  border: 3px solid #e2e8f0;
  border-bottom-width: 5px;
  background: #fff;
  font-size: 18px;
}

.quizHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.quizMeta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 3px solid #e2e8f0;
  border-bottom-width: 5px;
  font-size: 16px;
  color: var(--muted);
  background: #f8fafc;
  font-weight: 700;
}

.quizBody {
  background: #fff;
  border-radius: var(--radius);
}

.topicLine {
  font-size: 18px;
  color: var(--blue);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prompt {
  font-size: 34px;
  font-weight: 800;
  margin: 12px 0 24px;
  line-height: 1.25;
  color: #0f172a;
}

.options {
  display: grid;
  gap: 16px;
}

.optionBtn {
  text-align: left;
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  border: 4px solid #cbd5e1;
  border-bottom-width: 8px;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 700;
  font-size: 24px;
  font-family: inherit;
  color: #1e293b;
  min-height: 70px;
  transition: all .1s cubic-bezier(0.4, 0, 0.2, 1);
}

.optionBtn:active,
.optionBtn:disabled {
  transform: translateY(4px);
  border-bottom-width: 4px;
  margin-bottom: 4px;
}

.optionBtn:hover:not(:disabled) {
  border-color: var(--blue);
  background: #f0f9ff;
}

.optionBtn.correct {
  border-color: var(--green-dark) !important;
  background: var(--green) !important;
  color: #fff !important;
}

.optionBtn.wrong {
  border-color: var(--red-dark) !important;
  background: var(--red) !important;
  color: #fff !important;
}

.feedback {
  margin-top: 24px;
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  border: 4px solid #cbd5e1;
  background: #fff;
  white-space: pre-line;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.4;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.feedback.ok {
  border-color: var(--green-dark);
  background: #f0fdf4;
  color: #166534;
}

.feedback.bad {
  border-color: var(--red-dark);
  background: #fef2f2;
  color: #991b1b;
}

.quizActions {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.quizActions .btn {
  width: auto;
  flex: 1;
  padding: 18px 24px;
  font-size: 22px;
}

.hint {
  margin-top: 16px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.resultsTitle {
  font-size: 42px;
  color: var(--blue);
  margin: 0 0 12px;
}

.scoreLine {
  font-weight: 800;
  font-size: 26px;
  margin-bottom: 20px;
  color: #1e293b;
}

.review {
  margin-top: 16px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 2px solid #e2e8f0;
  padding: 16px;
}

.review ul {
  padding-left: 24px;
  line-height: 1.6;
  font-size: 18px;
  margin: 0;
}

.review li {
  margin-bottom: 12px;
}

.resultsActions {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.resultsActions .btn {
  width: auto;
  flex: 1;
  font-size: 22px;
}

.footer {
  margin: 24px 0 12px;
  font-size: 15px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .tiles {
    grid-template-columns: 1fr;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }
}