/* ==========================================================================
   MISIÓN SABER · Academia de Cadetes
   Sistema visual: arcade espacial, sticker UI, alto contraste y movimiento.
   ========================================================================== */

@import url("/fonts/fonts.css");

:root {
  --bg: #080b23;
  --bg-deep: #050716;
  --panel: #121838;
  --panel-2: #171f4a;
  --panel-3: #1e2857;
  --ink: #f8f7ff;
  --ink-soft: #d9dcf5;
  --muted: #a3aad3;
  --muted-2: #7c84b5;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --lime: #c6ff4a;
  --lime-deep: #8fbf22;
  --cyan: #5ce1ff;
  --coral: #ff7a59;
  --gold: #ffd166;
  --violet: #b18cff;
  --pink: #ff8fc8;
  --green: #63e6a6;
  --red: #ff6b81;
  --outline: #0a0d26;
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-card: 0 18px 40px -18px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-pop: 0 24px 60px -12px rgba(0, 0, 0, 0.8);
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", "Avenir Next", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --topbar-h: 78px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

button:disabled {
  cursor: default;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--lime);
  color: var(--outline);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 8px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--outline);
  font-weight: 900;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 16px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ==========================================================================
   Fondo espacial
   ========================================================================== */

.space-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 12% -10%, rgba(69, 55, 160, 0.5), transparent 60%),
    radial-gradient(1000px 700px at 92% 4%, rgba(16, 103, 145, 0.35), transparent 62%),
    radial-gradient(900px 700px at 60% 110%, rgba(120, 40, 100, 0.28), transparent 60%),
    linear-gradient(180deg, #090d28 0%, #070a1f 55%, #050716 100%);
}

.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.nebula-a {
  width: 46vw;
  height: 36vw;
  top: 8%;
  left: -12%;
  background: radial-gradient(circle, rgba(94, 76, 230, 0.55), transparent 65%);
}

.nebula-b {
  width: 38vw;
  height: 38vw;
  right: -10%;
  top: 36%;
  background: radial-gradient(circle, rgba(20, 165, 190, 0.35), transparent 65%);
}

.starfield {
  position: absolute;
  inset: -10%;
  background-repeat: repeat;
  opacity: 0.8;
}

.starfield-a {
  background-image:
    radial-gradient(1.6px 1.6px at 22px 38px, #ffffff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 118px 92px, #b9c7ff 50%, transparent 51%),
    radial-gradient(1px 1px at 76px 160px, #ffffff 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 190px 24px, #ffe9b0 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 156px 210px, #ffffff 50%, transparent 51%);
  background-size: 240px 240px;
  animation: drift 160s linear infinite;
}

.starfield-b {
  background-image:
    radial-gradient(1.2px 1.2px at 60px 60px, #9fe9ff 50%, transparent 51%),
    radial-gradient(2px 2px at 210px 140px, #ffffff 50%, transparent 51%),
    radial-gradient(1px 1px at 140px 20px, #ffffff 50%, transparent 51%);
  background-size: 320px 320px;
  opacity: 0.45;
  animation: drift 220s linear infinite reverse;
}

@keyframes drift {
  to {
    transform: translate3d(-240px, 120px, 0);
  }
}

.planet {
  position: absolute;
  border-radius: 50%;
  opacity: 0.55;
}

.planet-a {
  width: 190px;
  height: 190px;
  right: 6%;
  top: 64%;
  background: radial-gradient(circle at 32% 30%, #ffcf8c 0%, #e7784e 42%, #7b2d46 78%, #2a122f 100%);
  box-shadow: 0 0 70px rgba(255, 137, 90, 0.25);
}

.planet-a::after {
  content: "";
  position: absolute;
  inset: -22% -46%;
  border: 10px solid rgba(255, 209, 102, 0.28);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.planet-b {
  width: 110px;
  height: 110px;
  left: 3%;
  bottom: 10%;
  background: radial-gradient(circle at 35% 30%, #b9f0ff, #3f8ed6 55%, #1b2e77 100%);
  box-shadow: 0 0 50px rgba(92, 225, 255, 0.2);
}

/* ==========================================================================
   Shell
   ========================================================================== */

.app-shell {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
}

#screen {
  flex: 1;
  width: 100%;
  outline: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(8, 11, 35, 0.92), rgba(8, 11, 35, 0.62));
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  width: min(1240px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 15px;
  background: linear-gradient(145deg, #2b3c8f, #141d4a);
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: rotate(-4deg);
  color: var(--lime);
}

.brand-mark .icon {
  width: 26px;
  height: 26px;
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 0.88;
  font-family: var(--display);
  letter-spacing: 0.06em;
}

.brand-name span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.brand-name strong {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
}

.brand-name strong em {
  font-style: normal;
  color: var(--lime);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  transition: border-color 0.2s, background 0.2s;
}

.player-chip:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--outline);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold), var(--coral));
  color: var(--outline);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
}

.player-meta {
  display: flex;
  min-width: 92px;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.player-meta b {
  max-width: 120px;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-bar {
  display: block;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}

.level-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
}

.level-pill {
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(198, 255, 74, 0.12);
  color: var(--lime);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.icon-btn {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink-soft);
  transition: transform 0.18s var(--ease), background 0.18s, color 0.18s, border-color 0.18s;
}

.icon-btn .icon {
  width: 20px;
  height: 20px;
}

.icon-btn:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

.icon-btn.is-on {
  border-color: rgba(198, 255, 74, 0.4);
  background: rgba(198, 255, 74, 0.12);
  color: var(--lime);
}

.site-footer {
  display: flex;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 30px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.site-footer .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted-2);
}

/* ==========================================================================
   Utilidades
   ========================================================================== */

.screen {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 12px 0 6px;
  animation: screen-in 0.45s var(--ease) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), transparent 45%),
    linear-gradient(180deg, #181f47, #0e1330);
  box-shadow: var(--shadow-card);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.btn {
  display: inline-flex;
  min-height: 50px;
  padding: 0 22px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 2px solid transparent;
  border-radius: 16px;
  font-family: var(--display);
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: transform 0.16s var(--ease), box-shadow 0.16s, background 0.16s, border-color 0.16s;
}

.btn .icon {
  width: 20px;
  height: 20px;
}

.btn-primary {
  background: var(--lime);
  color: var(--outline);
  box-shadow: 0 6px 0 var(--lime-deep), 0 16px 26px -14px rgba(198, 255, 74, 0.8);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--lime-deep), 0 20px 30px -14px rgba(198, 255, 74, 0.9);
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--lime-deep);
}

.btn-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
}

.btn-ghost {
  min-height: 44px;
  padding: 0 14px;
  border-color: transparent;
  color: var(--ink-soft);
  font-size: 14.5px;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
}

.btn-lg {
  min-height: 58px;
  padding: 0 28px;
  border-radius: 18px;
  font-size: 19px;
}

.btn-block {
  width: 100%;
}

.text-btn {
  display: inline-flex;
  padding: 6px 2px;
  align-items: center;
  gap: 5px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.text-btn .icon {
  width: 13px;
  height: 13px;
}

.voice-toggle {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.voice-toggle:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.text-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.chip .icon {
  width: 14px;
  height: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Home · hero
   ========================================================================== */

.home {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.is-home .site-footer {
  display: none;
}

.hero {
  position: relative;
  display: grid;
  min-height: 300px;
  padding: 26px 34px 22px;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: 20px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at 75% 40%, #000 0%, transparent 62%);
  opacity: 0.5;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -90px;
  top: -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(92, 225, 255, 0.2), transparent 68%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero h1 {
  margin: 8px 0 8px;
  font-family: var(--display);
  font-size: clamp(40px, 4.3vw, 56px);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 0.98;
}

.hero h1 .marker {
  position: relative;
  color: var(--lime);
  white-space: nowrap;
}

.hero h1 .marker::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 2px;
  height: 9px;
  border-radius: 99px;
  background: var(--lime);
  opacity: 0.22;
  transform: rotate(-1.5deg);
}

.hero-sub {
  color: var(--ink-soft);
  font-size: 0.58em;
  font-weight: 700;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 520px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-badges {
  display: flex;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 7px;
}

.hero-badges .chip {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 10.5px;
}

.hero-badges .chip .icon {
  color: var(--gold);
}

.hero-art {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 260px;
  align-items: center;
  justify-content: center;
}

.mascot-float {
  position: relative;
  width: min(225px, 80%);
  filter: drop-shadow(0 30px 28px rgba(0, 0, 0, 0.45));
  animation: mascot-float 5.5s ease-in-out infinite;
}

@keyframes mascot-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1.5deg);
  }
  50% {
    transform: translateY(-13px) rotate(1.5deg);
  }
}

.speech {
  position: absolute;
  z-index: 3;
  top: 2px;
  right: -6px;
  max-width: 190px;
  padding: 12px 15px;
  border: 2px solid var(--outline);
  border-radius: 16px 16px 16px 4px;
  background: var(--ink);
  color: var(--outline);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18);
  transform: rotate(2deg);
}

.speech b {
  color: #5a3bd6;
}

.orbit-chip {
  position: absolute;
  cursor: pointer;
  z-index: 2;
  display: inline-flex;
  padding: 6px 10px;
  align-items: center;
  gap: 5px;
  border: 1.5px solid var(--outline);
  border-radius: 999px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  animation: bob 4s ease-in-out infinite;
}

.orbit-chip .icon {
  width: 13px;
  height: 13px;
}

.chip-en {
  left: 0;
  top: 30%;
  background: var(--cyan);
  color: var(--outline);
  animation-delay: -1s;
}

.chip-mate {
  right: 2%;
  bottom: 18%;
  background: var(--gold);
  color: var(--outline);
  animation-delay: -2.4s;
}

.chip-cien {
  left: 8%;
  bottom: 4%;
  background: var(--lime);
  color: var(--outline);
  animation-delay: -0.4s;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-7px) rotate(2deg);
  }
}

/* ==========================================================================
   Home · stats y materias
   ========================================================================== */

.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  display: flex;
  padding: 10px 14px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #111733;
}

.stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--accent, var(--cyan));
}

.stat-icon .icon {
  width: 19px;
  height: 19px;
}

.stat-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.stat-copy b {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stat-copy span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-head {
  display: flex;
  margin-top: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.section-head h2 {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-head p {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.subject-card {
  position: relative;
  display: flex;
  background-color: #171f4a;
  min-height: 150px;
  padding: 15px 16px 13px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 100% at 100% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 58%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), transparent 40%),
    linear-gradient(180deg, #171f4a, #101532);
  text-align: left;
  transition: transform 0.22s var(--ease), border-color 0.22s, box-shadow 0.22s;
}

.subject-card::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -32px;
  width: 120px;
  height: 120px;
  border: 18px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 50%;
  transition: transform 0.4s var(--ease);
}

.subject-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 22px 40px -22px color-mix(in srgb, var(--accent) 65%, transparent);
}

.subject-card:hover::after {
  transform: scale(1.15) rotate(12deg);
}

.subject-card:active {
  transform: translateY(-1px);
}

.sc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sc-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--outline);
  border-radius: 13px;
  background: var(--accent);
  color: var(--outline);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3);
  transform: rotate(-3deg);
}

.sc-icon .icon {
  width: 24px;
  height: 24px;
}

.sc-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: rgba(255, 255, 255, 0.45);
}

.sc-stars .icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.sc-stars .is-on {
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(255, 209, 102, 0.45));
}

.sc-stars .is-on .icon {
  fill: currentColor;
  stroke: currentColor;
}

.sc-rating {
  margin-left: 4px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.subject-card .sc-title {
  display: block;
  margin-top: 10px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.subject-card .sc-title small {
  display: block;
  margin-top: 3px;
  color: var(--accent);
  font-family: var(--body);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.sc-meta {
  display: flex;
  margin-top: auto;
  padding-top: 8px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.sc-meta b {
  color: var(--ink-soft);
}

.sc-go {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  transition: background 0.2s, transform 0.2s;
}

.sc-go .icon {
  width: 14px;
  height: 14px;
}

.subject-card:hover .sc-go {
  background: var(--accent);
  color: var(--outline);
  transform: translateX(3px);
}

.subject-card.is-mixed {
  --accent: var(--pink);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(255, 143, 200, 0.26), transparent 58%),
    radial-gradient(100% 100% at 0% 100%, rgba(91, 225, 255, 0.18), transparent 55%),
    linear-gradient(180deg, #2a1f4f, #141331);
}

.subject-card.is-mixed .sc-icon {
  background: linear-gradient(145deg, var(--pink), var(--gold));
}

.mixed-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--outline);
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: rotate(3deg);
}

/* ==========================================================================
   Briefing / modal
   ========================================================================== */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  padding: 20px;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 20, 0.72);
  backdrop-filter: blur(10px);
  animation: fade-in 0.2s ease both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.modal {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88svh, 860px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background:
    radial-gradient(100% 80% at 100% 0%, rgba(92, 225, 255, 0.12), transparent 55%),
    linear-gradient(180deg, #1a2352, #0f1436);
  box-shadow: var(--shadow-pop);
  animation: modal-in 0.3s var(--ease) both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
}

.modal.wide {
  width: min(720px, 100%);
}

.modal-head {
  position: relative;
  padding: 24px 26px 12px;
}

.modal-kicker {
  color: var(--accent, var(--cyan));
}

.modal-head h2 {
  margin-top: 5px;
  padding-right: 42px;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.02;
}

.modal-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
}

.modal-body {
  padding: 8px 26px 4px;
}

.modal-actions {
  display: flex;
  padding: 18px 26px 24px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.modal-actions .btn {
  min-height: 48px;
}

.modal-actions .spacer {
  flex: 1;
}

.brief-hero {
  display: flex;
  padding: 16px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.brief-icon {
  display: grid;
  width: 58px;
  height: 58px;
  flex: none;
  place-items: center;
  border: 2px solid var(--outline);
  border-radius: 18px;
  background: var(--accent, var(--cyan));
  color: var(--outline);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25);
}

.brief-icon .icon {
  width: 30px;
  height: 30px;
}

.brief-hero h3 {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.05;
}

.brief-hero p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.brief-grid {
  display: grid;
  margin-top: 14px;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.brief-cell {
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.brief-cell b {
  display: block;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 800;
}

.brief-cell span {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brief-list {
  display: flex;
  margin-top: 14px;
  flex-direction: column;
  gap: 8px;
  list-style: none;
}

.brief-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.brief-list .icon {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--lime);
}

.voice-status {
  display: flex;
  margin-top: 14px;
  padding: 10px 12px;
  align-items: center;
  gap: 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.voice-status .icon {
  width: 16px;
  height: 16px;
  color: var(--cyan);
}

.voice-status b {
  color: var(--ink-soft);
}

.voice-status.is-off .icon {
  color: var(--muted-2);
}

/* ==========================================================================
   Quiz
   ========================================================================== */

.quiz {
  width: min(1080px, calc(100% - 40px));
  margin-inline: auto;
  padding-top: 18px;
}

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

.quiz-hud .icon-btn {
  flex: none;
}

.quiz-progress {
  flex: 1;
}

.qp-label {
  display: flex;
  margin-bottom: 7px;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.qp-label b {
  color: var(--ink);
  font-family: var(--display);
  font-size: 16px;
}

.qp-subject {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent, var(--cyan));
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.qp-track {
  display: flex;
  gap: 4px;
}

.qp-seg {
  height: 7px;
  flex: 1;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}

.qp-seg i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent, var(--cyan));
  transition: width 0.35s var(--ease);
}

.qp-seg.is-done i {
  width: 100%;
}

.qp-seg.is-current i {
  width: 100%;
  background: linear-gradient(90deg, var(--accent, var(--cyan)), var(--lime));
}

.qp-seg.is-good i {
  width: 100%;
  background: var(--green);
}

.qp-seg.is-bad i {
  width: 100%;
  background: var(--red);
}

.quiz-hud-right {
  display: flex;
  flex: none;
  gap: 7px;
}

.score-chip,
.streak-chip {
  display: inline-flex;
  height: 40px;
  padding: 0 12px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.score-chip .icon {
  color: var(--gold);
  fill: var(--gold);
}

.streak-chip .icon {
  color: var(--coral);
}

.streak-chip.is-cold {
  opacity: 0.45;
}

.quiz-card {
  position: relative;
  margin-top: 14px;
  padding: 24px 30px 20px;
  overflow: hidden;
}

.quiz-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--cyan)), transparent);
  opacity: 0.85;
}

.q-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topic-chip {
  display: inline-flex;
  max-width: 62%;
  padding: 6px 11px;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent, var(--cyan)) 40%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, var(--cyan)) 12%, transparent);
  color: var(--accent, var(--cyan));
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.topic-chip .icon {
  width: 13px;
  height: 13px;
}

.q-lang {
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.timer {
  position: relative;
  display: grid;
  width: 72px;
  height: 72px;
  margin-left: auto;
  flex: none;
  place-items: center;
}

.timer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 7;
}

.timer-bar {
  fill: none;
  stroke: var(--lime);
  stroke-linecap: round;
  stroke-width: 7;
  stroke-dasharray: 201;
  stroke-dashoffset: 0;
  transition: stroke 0.3s;
}

.timer b {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.timer small {
  margin-top: -2px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timer.is-warn .timer-bar {
  stroke: var(--coral);
}

.timer.is-warn b {
  color: var(--coral);
  animation: timer-pulse 0.8s ease-in-out infinite;
}

.timer.is-paused .timer-bar {
  stroke: var(--cyan);
  opacity: 0.5;
}

.timer.is-paused b {
  color: var(--cyan);
  font-size: 18px;
}

.timer.is-paused small {
  color: var(--cyan);
}

.timer.is-done .timer-bar {
  stroke: var(--green);
  opacity: 0.35;
}

.timer.is-done b {
  color: var(--green);
  font-size: 25px;
}

.timer.is-done small {
  color: var(--green);
}

@keyframes timer-pulse {
  50% {
    transform: scale(1.12);
  }
}

.q-body {
  display: flex;
  margin: 10px 0 16px;
  align-items: flex-start;
  gap: 14px;
}

.q-text {
  max-width: 820px;
  flex: 1;
  font-family: var(--display);
  font-size: clamp(23px, 2.6vw, 32px);
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.14;
}

.q-text.is-en {
  font-family: var(--body);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.listen-btn {
  display: inline-flex;
  height: 40px;
  padding: 0 13px;
  flex: none;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 800;
  transition: background 0.2s, border-color 0.2s;
}

.listen-btn:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.1);
}

.listen-btn.is-speaking {
  border-color: var(--cyan);
  color: var(--cyan);
}

.listen-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.listen-btn .icon {
  width: 16px;
  height: 16px;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.option {
  position: relative;
  display: flex;
  min-height: 66px;
  padding: 12px 15px;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-soft);
  text-align: left;
  transition: transform 0.14s var(--ease), border-color 0.14s, background 0.14s, opacity 0.2s;
}

.option:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent, var(--cyan)) 55%, transparent);
  background: color-mix(in srgb, var(--accent, var(--cyan)) 9%, transparent);
}

.option:active:not(:disabled) {
  transform: translateY(1px);
}

.option-key {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.option-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.option.is-correct {
  border-color: var(--green);
  background: rgba(99, 230, 166, 0.14);
  color: #eafff5;
  animation: pop-correct 0.35s var(--ease);
}

.option.is-correct .option-key {
  border-color: var(--green);
  background: var(--green);
  color: var(--outline);
}

.option.is-wrong {
  border-color: var(--red);
  background: rgba(255, 107, 129, 0.13);
  color: #ffe8ec;
  animation: shake 0.4s;
}

.option.is-wrong .option-key {
  border-color: var(--red);
  background: var(--red);
  color: var(--outline);
}

.option.is-reveal {
  border-color: var(--green);
  border-style: dashed;
}

.option.is-reveal .option-key {
  border-color: var(--green);
  color: var(--green);
}

.option.is-dim {
  opacity: 0.6;
}

.option-mark {
  display: grid;
  width: 24px;
  height: 24px;
  margin-left: auto;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.option-mark .icon {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.option-mark.good {
  background: rgba(99, 230, 166, 0.18);
  color: var(--green);
}

.option-mark.bad {
  background: rgba(255, 107, 129, 0.18);
  color: var(--red);
}

.option.is-locked {
  cursor: default;
}

@keyframes pop-correct {
  40% {
    transform: scale(1.015);
  }
}

@keyframes shake {
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

.q-foot {
  display: flex;
  margin-top: 13px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 700;
}

.q-foot-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.keyhint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.keyhint kbd {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-soft);
  font-family: var(--body);
  font-size: 9.5px;
  font-weight: 800;
}

.quiz-mascot {
  position: fixed;
  right: max(18px, calc((100vw - 1240px) / 2));
  bottom: 18px;
  z-index: 5;
  width: 104px;
  opacity: 0.95;
  pointer-events: none;
  filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.4));
  animation: mascot-float 6s ease-in-out infinite;
}

/* ==========================================================================
   Pista y leyenda de puntos
   ========================================================================== */

.quiz-extra {
  display: flex;
  margin-top: 14px;
  padding: 9px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #111733;
  transition: opacity 0.2s;
}

.quiz.has-feedback .quiz-extra {
  opacity: 0;
  visibility: hidden;
}

.nova-tip {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.nova-tip img {
  width: 42px;
  height: 50px;
  flex: none;
  object-fit: contain;
}

.nova-tip p {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
}

.nova-tip b {
  color: var(--ink-soft);
}

.score-legend {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.score-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.score-legend .icon {
  width: 12px;
  height: 12px;
}

.score-legend span:nth-child(1) .icon {
  color: var(--green);
}

.score-legend span:nth-child(2) .icon {
  color: var(--gold);
}

.score-legend span:nth-child(3) .icon {
  color: var(--coral);
}

/* ==========================================================================
   Feedback
   ========================================================================== */

.feedback-layer {
  position: fixed;
  z-index: 90;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  padding: 18px 20px max(18px, env(safe-area-inset-bottom));
  justify-content: center;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(4, 6, 20, 0.55));
  animation: fade-in 0.2s ease both;
}

.feedback {
  display: grid;
  width: min(920px, 100%);
  padding: 18px 20px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 2px solid var(--tone, var(--green));
  border-radius: 22px;
  background:
    radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--tone, var(--green)) 16%, transparent), transparent 55%),
    linear-gradient(180deg, #1a2350, #0e1435);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.8);
  pointer-events: auto;
  animation: feedback-in 0.35s var(--ease) both;
}

@keyframes feedback-in {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }
}

.feedback[data-tone="bad"] {
  --tone: var(--red);
}

.feedback[data-tone="good"] {
  --tone: var(--green);
}

.fb-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid var(--outline);
  border-radius: 18px;
  background: var(--tone);
  color: var(--outline);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3);
}

.fb-icon .icon {
  width: 30px;
  height: 30px;
  stroke-width: 2.8;
}

.fb-copy {
  min-width: 0;
}

.fb-kicker {
  display: block;
  color: var(--tone);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.fb-answer {
  display: flex;
  margin-top: 4px;
  align-items: baseline;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.fb-letter {
  display: inline-grid;
  width: 21px;
  height: 21px;
  flex: none;
  place-items: center;
  border-radius: 6px;
  background: var(--tone);
  color: var(--outline);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 800;
}

.fb-exp {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.fb-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.points {
  color: var(--gold);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.points.is-zero {
  color: var(--muted-2);
}

.fb-side .btn {
  min-height: 44px;
  padding: 0 18px;
  font-size: 14.5px;
  white-space: nowrap;
}

/* ==========================================================================
   Resultados
   ========================================================================== */

.results {
  width: min(1000px, calc(100% - 40px));
}

.result-hero {
  position: relative;
  padding: 30px 34px 26px;
  overflow: hidden;
  text-align: center;
}

.result-hero::before {
  content: "";
  position: absolute;
  width: 560px;
  height: 280px;
  top: -170px;
  left: 50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198, 255, 74, 0.22), transparent 68%);
  transform: translateX(-50%);
  pointer-events: none;
}

.result-mascot {
  position: absolute;
  right: 4%;
  bottom: 0;
  width: 150px;
  opacity: 0.95;
  filter: drop-shadow(0 16px 14px rgba(0, 0, 0, 0.35));
  animation: mascot-float 6s ease-in-out infinite;
}

.result-copy {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.result-copy h1 {
  margin-top: 7px;
  font-family: var(--display);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.98;
}

.big-stars {
  display: flex;
  margin: 14px 0 6px;
  justify-content: center;
  gap: 7px;
}

.big-star {
  position: relative;
  width: 44px;
  height: 44px;
  color: rgba(255, 255, 255, 0.12);
}

.big-star .icon {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 1.2;
}

.big-star.is-on {
  color: var(--gold);
  filter: drop-shadow(0 0 14px rgba(255, 209, 102, 0.55));
  animation: star-pop 0.5s var(--ease) both;
}

.big-star:nth-child(2) {
  animation-delay: 0.12s;
}

.big-star:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes star-pop {
  from {
    opacity: 0;
    transform: scale(0.4) rotate(-30deg);
  }
}

.result-lead {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.scoreline {
  display: inline-flex;
  margin-top: 14px;
  padding: 6px 20px 8px;
  align-items: baseline;
  gap: 7px;
  border: 1px solid rgba(255, 209, 102, 0.3);
  border-radius: 18px;
  background: rgba(255, 209, 102, 0.08);
}

.scoreline b {
  color: var(--gold);
  font-family: var(--display);
  font-size: 40px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.scoreline span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.result-stats {
  display: grid;
  max-width: 720px;
  margin: 20px auto 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.result-stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.result-stat b {
  display: block;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.result-stat span {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-actions {
  display: flex;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.review {
  margin-top: 16px;
  padding: 22px 24px;
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.review-head h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
}

.review-head p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.review-list {
  display: flex;
  margin-top: 12px;
  flex-direction: column;
  gap: 7px;
}

.review-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.028);
}

.review-item[open] {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.review-item summary {
  display: flex;
  padding: 10px 13px;
  align-items: center;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  transition: background 0.15s;
}

.review-item summary::-webkit-details-marker {
  display: none;
}

.review-item summary:hover {
  background: rgba(255, 255, 255, 0.04);
}

.review-status {
  display: grid;
  width: 25px;
  height: 25px;
  flex: none;
  place-items: center;
  border-radius: 8px;
}

.review-status .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.8;
}

.review-status.good {
  background: rgba(99, 230, 166, 0.16);
  color: var(--green);
}

.review-status.bad {
  background: rgba(255, 107, 129, 0.16);
  color: var(--red);
}

.review-status.time {
  background: rgba(255, 209, 102, 0.14);
  color: var(--gold);
}

.review-summary-text {
  flex: 1;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-topic {
  flex: none;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.review-chevron {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--muted-2);
  transition: transform 0.2s;
}

.review-item[open] .review-chevron {
  transform: rotate(180deg);
}

.review-body {
  padding: 0 13px 13px 48px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.review-body .answer-row {
  display: flex;
  margin-top: 3px;
  gap: 5px;
}

.review-body .answer-row b {
  color: var(--ink-soft);
}

.review-body .exp {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}

.review-num {
  flex: none;
  min-width: 14px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 900;
  text-align: right;
}

.review-xp {
  margin-top: 6px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ==========================================================================
   Settings / badges / how-to
   ========================================================================== */

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.set-row {
  display: flex;
  min-height: 54px;
  padding: 9px 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.set-row:last-child {
  border-bottom: 0;
}

.set-copy b {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.set-copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
}

.switch {
  position: relative;
  width: 50px;
  height: 28px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s, border-color 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s var(--ease), background 0.2s;
}

.switch[aria-checked="true"] {
  border-color: rgba(198, 255, 74, 0.5);
  background: rgba(198, 255, 74, 0.18);
}

.switch[aria-checked="true"]::after {
  background: var(--lime);
  transform: translateX(22px);
}

.name-input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.name-input:focus {
  border-color: var(--cyan);
  outline: none;
}

.range {
  width: 130px;
  accent-color: var(--lime);
}

.danger-btn {
  padding: 8px 12px;
  border: 1px solid rgba(255, 107, 129, 0.4);
  border-radius: 10px;
  background: rgba(255, 107, 129, 0.08);
  color: var(--red);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.danger-btn:hover {
  background: rgba(255, 107, 129, 0.16);
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.badge-card {
  display: flex;
  padding: 12px;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
}

.badge-card.is-locked {
  opacity: 0.48;
}

.badge-medal {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border: 2px solid var(--outline);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold), #ff9e5e);
  color: var(--outline);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}

.badge-card.is-locked .badge-medal {
  background: #3c457a;
  color: #8d95c4;
}

.badge-medal .icon {
  width: 22px;
  height: 22px;
}

.badge-copy b {
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}

.badge-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.25;
}

.how-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.how-step {
  display: flex;
  padding: 12px;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.how-num {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border: 2px solid var(--outline);
  border-radius: 9px;
  background: var(--cyan);
  color: var(--outline);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
}

.how-step:nth-child(2) .how-num {
  background: var(--lime);
}

.how-step:nth-child(3) .how-num {
  background: var(--gold);
}

.how-step b {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.how-step p {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.welcome-art {
  display: flex;
  margin: 0 auto 4px;
  width: 120px;
}

.field-label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.levelup-banner {
  display: flex;
  margin-top: 14px;
  padding: 10px 14px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(198, 255, 74, 0.35);
  border-radius: 14px;
  background: rgba(198, 255, 74, 0.1);
  color: var(--lime);
  font-size: 12.5px;
  font-weight: 800;
}

/* ==========================================================================
   Toasts / confetti / estados
   ========================================================================== */

.toast-stack {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  display: flex;
  width: min(340px, calc(100vw - 36px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  padding: 11px 14px;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--toast-accent, var(--cyan));
  border-radius: 12px;
  background: #151c45;
  box-shadow: 0 16px 30px -12px rgba(0, 0, 0, 0.7);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  animation: toast-in 0.3s var(--ease) both;
  pointer-events: auto;
}

.toast .icon {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  flex: none;
  color: var(--toast-accent, var(--cyan));
}

.toast.is-out {
  animation: toast-out 0.25s ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 150;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  padding: 30px;
  place-items: center;
  background: var(--bg);
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}

.empty-state {
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state .icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  color: var(--muted-2);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1060px) {
  .hero {
    grid-template-columns: minmax(0, 1.3fr) minmax(230px, 0.7fr);
    padding: 28px 30px 24px;
  }

  .hero-art {
    min-height: 230px;
  }

  .subject-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-mascot {
    width: 120px;
    opacity: 0.85;
  }
}

@media (max-width: 820px) {
  :root {
    --topbar-h: 68px;
  }

  .topbar-inner {
    width: calc(100% - 28px);
  }

  .player-meta {
    display: none;
  }

  .player-chip {
    padding: 4px;
    border-radius: 50%;
  }

  .level-pill {
    display: none;
  }

  .avatar {
    width: 36px;
    height: 36px;
  }

  .brand-name strong {
    font-size: 20px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .topbar-actions .icon-btn[data-open="badges"] {
    display: none;
  }

  .screen {
    width: calc(100% - 28px);
    padding-top: 16px;
  }

  .quick-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .subject-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .subject-card {
    min-height: 158px;
  }

  .quiz {
    width: calc(100% - 28px);
  }

  .quiz-card {
    padding: 18px 16px 14px;
  }

  .q-text {
    font-size: clamp(21px, 5.4vw, 27px);
  }

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

  .option {
    min-height: 58px;
    padding: 10px 12px;
  }

  .option-text {
    font-size: 13.5px;
  }

  .timer {
    width: 64px;
    height: 64px;
  }

  .q-body {
    flex-direction: column;
    gap: 8px;
  }

  .listen-btn {
    height: 40px;
  }

  .quiz-mascot {
    display: none;
  }

  .feedback {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 15px;
  }

  .fb-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .fb-icon .icon {
    width: 24px;
    height: 24px;
  }

  .fb-side {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .fb-side .btn {
    flex: 1;
    max-width: 210px;
  }

  .result-hero {
    padding: 24px 20px 20px;
  }

  .result-mascot {
    position: static;
    width: 100px;
    margin: 0 auto 8px;
  }

  .result-stats {
    gap: 7px;
  }

  .review {
    padding: 18px 14px;
  }

  .review-topic {
    display: none;
  }

  .review-summary-text {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .modal-layer {
    padding: 12px;
    align-items: flex-end;
  }

  .modal {
    max-height: 92svh;
    border-radius: 24px;
  }

  .modal-head {
    padding: 20px 20px 8px;
  }

  .modal-body {
    padding: 6px 20px 2px;
  }

  .modal-actions {
    padding: 14px 20px 20px;
  }

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

  .site-footer {
    width: calc(100% - 28px);
    padding: 20px 0 24px;
    font-size: 10px;
  }
}

@media (max-width: 1100px) {
  .speech,
  .orbit-chip {
    display: none;
  }
}

@media (max-width: 700px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 24px 22px 10px;
    text-align: left;
  }

  .hero-art {
    min-height: 210px;
    margin-top: -8px;
  }

  .mascot-float {
    width: 210px;
  }

  .hero h1 {
    font-size: clamp(36px, 9vw, 48px);
  }
}

@media (max-height: 760px) {
  .quiz-mascot {
    display: none;
  }
}

@media (max-width: 560px) {
  .brand-name span {
    font-size: 9px;
  }

  .brand-name strong {
    font-size: 18px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .brand-mark .icon {
    width: 21px;
    height: 21px;
  }

  .hero {
    padding: 20px 18px 6px;
  }

  .hero-lead {
    font-size: 13px;
  }

  .hero-actions .btn {
    flex: 1 1 100%;
    min-height: 50px;
  }

  .hero-actions .btn-secondary {
    flex: 0 0 auto;
  }

  .hero-badges {
    display: none;
  }

  .hero-art {
    min-height: 170px;
    margin-top: 0;
  }

  .mascot-float {
    width: 160px;
  }

  .speech,
  .orbit-chip {
    display: none;
  }

  .quiz-extra {
    display: none;
  }

  .review-head .chip {
    display: none;
  }

  .review-head h2 {
    font-size: 21px;
  }

  .result-stat span {
    font-size: 8px;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  .toast-stack {
    top: calc(var(--topbar-h) + 10px);
    right: 10px;
    bottom: auto;
  }

  .stat-card {
    padding: 10px 12px;
    gap: 9px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
  }

  .stat-copy b {
    font-size: 18px;
  }

  .section-head h2 {
    font-size: 22px;
  }

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

  .subject-card {
    min-height: 148px;
  }

  .sc-desc {
    max-width: 90%;
  }

  .quiz-hud {
    gap: 7px;
  }

  .quiz-hud-right {
    flex-direction: column;
  }

  .score-chip,
  .streak-chip {
    height: 30px;
    padding: 0 8px;
    font-size: 12px;
    border-radius: 9px;
  }

  .qp-subject {
    display: none;
  }

  .timer {
    width: 56px;
    height: 56px;
  }

  .timer b {
    font-size: 21px;
  }

  .timer small {
    font-size: 6.5px;
  }

  .q-top {
    gap: 7px;
  }

  .q-foot .keyhint {
    display: none;
  }

  .feedback-layer {
    padding: 10px;
  }

  .feedback {
    border-radius: 18px;
  }

  .fb-exp {
    font-size: 11.5px;
  }

  .result-copy h1 {
    font-size: 34px;
  }

  .result-actions .btn {
    flex: 1 1 100%;
  }

  .review-body {
    padding-left: 13px;
  }

  .brief-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .brief-cell {
    padding: 8px 5px;
  }

  .brief-cell b {
    font-size: 15px;
  }

  .brief-cell span {
    font-size: 7.5px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .modal-actions .spacer {
    display: none;
  }

  .toast-stack {
    right: 10px;
  }
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: 34px;
  }

  .speech {
    max-width: 150px;
    font-size: 12px;
  }

  .mascot-float {
    width: 180px;
  }
}

@media (pointer: coarse) {
  .keyhint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}


/* ==========================================================================
   Estados de carga, avisos y detalles finales
   ========================================================================== */

.loader-wrap {
  display: flex;
  min-height: 62svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  text-align: center;
}

.loader-orbit {
  position: relative;
  display: grid;
  width: 150px;
  height: 150px;
  margin-bottom: 20px;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  animation: spin 12s linear infinite;
}

.loader-orbit::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px var(--gold);
}

.loader-orbit img {
  width: 100px;
  animation: spin 12s linear infinite reverse, mascot-float 4s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loader-title {
  margin-top: 4px;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 800;
}

.loader-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.loader-bar {
  width: min(260px, 80%);
  height: 7px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}

.loader-bar i {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  animation: load-slide 1.2s ease-in-out infinite;
}

@keyframes load-slide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(360%);
  }
}

.empty-state {
  display: flex;
  min-height: 46svh;
  margin-top: 22px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.empty-title {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 800;
}

.empty-state .btn {
  margin-top: 10px;
}

.section-note {
  color: var(--muted-2) !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.result-copy .levelup-banner {
  justify-content: center;
  text-align: left;
}

.is-quiz .site-footer {
  display: none;
}

.is-quiz .topbar-actions .player-chip,
.is-quiz .topbar-actions [data-open="badges"],
.is-quiz .topbar-actions [data-open="settings"] {
  display: none;
}

.is-quiz .topbar-actions::after {
  content: "MISIÓN EN CURSO";
  display: inline-flex;
  padding: 5px 9px;
  align-items: center;
  border: 1px solid rgba(198, 255, 74, 0.3);
  border-radius: 999px;
  background: rgba(198, 255, 74, 0.08);
  color: var(--lime);
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

@media (max-width: 560px) {
  .is-quiz .topbar-actions::after {
    display: none;
  }

  .section-note {
    display: none;
  }
}
