:root {
  --ink: #172033;
  --muted: #667085;
  --line: rgba(23, 32, 51, 0.14);
  --panel: rgba(255, 255, 255, 0.9);
  --red: #f0183f;
  --blue: #1457b8;
  --green: #00a878;
  --gold: #f6b73c;
  --violet: #7a4ff3;
  --shadow: 0 22px 70px rgba(32, 45, 78, 0.16);
}

/* Selector y reproductor de pódcast por tema */
body.topic-podcast-open {
  overflow: hidden;
}

.topic-podcast-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 20px;
}

.topic-podcast-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(8, 28, 61, 0.68);
  box-shadow: none;
  cursor: default;
}

.topic-podcast-card {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid rgba(54, 112, 180, 0.2);
  border-radius: 30px;
  background: linear-gradient(145deg, #ffffff 0%, #f1f8ff 100%);
  box-shadow: 0 30px 80px rgba(4, 30, 72, 0.35);
}

.topic-podcast-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #d9e7f7;
}

.topic-podcast-head span {
  color: #58708f;
  font-size: 0.83rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.topic-podcast-head h2 {
  margin: 5px 0 0;
  color: #102746;
  font-size: clamp(1.55rem, 4vw, 2.35rem);
  line-height: 1.08;
}

.topic-podcast-intro > p {
  margin: 22px 0 16px;
  color: #536985;
  font-size: 1.05rem;
  text-align: center;
}

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

.topic-podcast-option {
  min-height: 190px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 22px;
  border: 2px solid transparent;
  border-radius: 26px;
  color: #fff;
  box-shadow: 0 12px 0 #0e478b, 0 22px 36px rgba(16, 71, 139, 0.18);
  transition: transform 160ms ease, filter 160ms ease;
}

.topic-podcast-option.is-express {
  background: linear-gradient(135deg, #176ac3, #05a58f);
}

.topic-podcast-option.is-master {
  background: linear-gradient(135deg, #6d4bd6, #e45a89);
  box-shadow: 0 12px 0 #5536a8, 0 22px 36px rgba(85, 54, 168, 0.18);
}

.topic-podcast-option:not(:disabled):hover,
.topic-podcast-option:not(:disabled):focus-visible {
  transform: translateY(-3px);
  filter: saturate(1.1) brightness(1.04);
}

.topic-podcast-option:disabled {
  opacity: 0.48;
  filter: grayscale(0.35);
  cursor: not-allowed;
}

.topic-podcast-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 2rem;
}

.topic-podcast-option strong {
  font-size: 1.75rem;
}

.topic-podcast-option small {
  font-size: 0.88rem;
  font-weight: 750;
  text-align: center;
}

.topic-podcast-player {
  padding-top: 24px;
}

.topic-podcast-now-playing {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #e7f2ff, #e5fbf6);
}

.topic-podcast-cover {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 21px;
  color: #fff;
  background: linear-gradient(135deg, #176ac3, #05a58f);
  font-size: 2rem;
  box-shadow: 0 8px 20px rgba(23, 106, 195, 0.24);
}

.topic-podcast-now-playing div {
  display: grid;
  gap: 4px;
}

.topic-podcast-now-playing small {
  color: #56708e;
  font-weight: 800;
}

.topic-podcast-now-playing strong {
  color: #102746;
  font-size: 1.25rem;
}

.topic-podcast-player audio {
  display: block;
  width: 100%;
  min-height: 54px;
}

.topic-podcast-player-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

@media (max-width: 620px) {
  .topic-podcast-modal { padding: 10px; }
  .topic-podcast-card { max-height: calc(100vh - 20px); padding: 18px; border-radius: 23px; }
  .topic-podcast-options { grid-template-columns: 1fr; }
  .topic-podcast-option { min-height: 142px; }
  .topic-podcast-head { align-items: center; }
  .topic-podcast-player-actions { flex-direction: column; }
}


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.1)),
    radial-gradient(circle at 12% 12%, rgba(20, 87, 184, 0.16), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(240, 24, 63, 0.14), transparent 28%),
    linear-gradient(135deg, #f8fbff 0%, #fff7ea 52%, #f4fff9 100%);
}

body::before {
  content: "∑  π  √  x²  ∫  %  Δ  =";
  position: fixed;
  inset: auto 0 28px 0;
  z-index: -1;
  color: rgba(20, 87, 184, 0.08);
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 950;
  letter-spacing: 18px;
  text-align: center;
  white-space: nowrap;
  animation: driftMath 18s linear infinite alternate;
}

@keyframes driftMath {
  from {
    transform: translateX(-4%);
  }
  to {
    transform: translateX(4%);
  }
}

button,
select,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  padding: 24px;
}

.top-strip,
.login-card,
.screen-panel,
.topic-card,
.question-box,
.admin-table {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.top-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(1280px, 100%);
  margin: 0 auto 22px;
  padding: 12px 120px 10px;
  border-radius: 8px;
  position: relative;
  min-height: 126px;
}

.top-strip-centered {
  justify-content: center;
}

.institutional-logo {
  width: min(820px, 100%);
  height: auto;
  object-fit: contain;
}

.logo-link {
  display: inline-flex;
  width: min(820px, 100%);
  border-radius: 8px;
}

.school-logo-link {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: auto;
  padding: 6px;
  transition: transform 0.22s ease;
}

.school-logo {
  width: clamp(150px, 16vw, 240px);
  height: auto;
  object-fit: contain;
  grid-area: 1 / 1;
  transition: transform 0.22s ease, filter 0.22s ease, opacity 0.24s ease;
}

.school-logo-hover {
  opacity: 0;
}

.school-logo-link::after {
  content: "Abrir web del centro";
  position: absolute;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%) translateY(6px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  color: white;
  background: #111827;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 0.78rem;
  font-weight: 900;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

.school-logo-link:hover,
.school-logo-link:focus-visible {
  transform: translateY(-3px) scale(1.04);
}

.school-logo-link:hover .school-logo,
.school-logo-link:focus-visible .school-logo {
  transform: rotate(-2deg);
}

.school-logo-link:hover .school-logo-base,
.school-logo-link:focus-visible .school-logo-base {
  opacity: 0;
}

.school-logo-link:hover .school-logo-hover,
.school-logo-link:focus-visible .school-logo-hover {
  opacity: 1;
  filter: drop-shadow(0 12px 18px rgba(20, 87, 184, 0.28));
}

.school-logo-link:hover::after,
.school-logo-link:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.corner-logo {
  position: absolute;
  top: 10px;
  width: clamp(58px, 6.5vw, 88px);
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

.corner-logo-left {
  left: 12px;
}

.corner-logo-right {
  right: 12px;
  width: clamp(80px, 8vw, 112px);
}

.brand-block {
  display: grid;
  justify-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.brand-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  flex-wrap: nowrap;
}

.site-title {
  flex: 0 0 auto;
  color: #111827;
  font-size: clamp(1.8rem, 3.6vw, 3.8rem);
  font-weight: 950;
  line-height: 1;
  max-width: none;
  white-space: nowrap;
}

.math-word {
  display: flex;
  justify-content: center;
  gap: clamp(3px, 0.8vw, 10px);
  color: #111827;
  font-size: clamp(1.6rem, 3.8vw, 4.2rem);
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 12px 26px rgba(20, 87, 184, 0.14);
}

.math-word span {
  display: inline-block;
  animation: mathBounce 1.8s ease-in-out infinite;
}

.math-word span:nth-child(2n) {
  color: var(--red);
  animation-delay: 0.1s;
}

.math-word span:nth-child(3n) {
  color: var(--blue);
  animation-delay: 0.2s;
}

.math-word span:nth-child(4n) {
  color: var(--green);
  animation-delay: 0.3s;
}

@keyframes mathBounce {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  45% {
    transform: translateY(-8px) rotate(-2deg);
  }
}

.logo-link:focus-visible,
.school-link a:focus-visible {
  outline: 3px solid rgba(20, 87, 184, 0.45);
  outline-offset: 4px;
}

.school-link {
  margin: -8px 0 20px;
  font-weight: 900;
}

.school-link a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 2px solid rgba(20, 87, 184, 0.28);
}

.school-link a:hover {
  color: var(--red);
  border-bottom-color: rgba(240, 24, 63, 0.42);
}

.student-pill {
  min-width: 220px;
  padding: 10px 14px;
  color: white;
  background: linear-gradient(135deg, var(--blue), #0f7d9d);
  border-radius: 8px;
  text-align: right;
  font-weight: 700;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(280px, 470px) minmax(320px, 1fr);
  gap: 26px;
  width: min(1160px, 100%);
  margin: 0 auto;
  align-items: stretch;
}

.login-layout-simple {
  grid-template-columns: minmax(280px, 460px);
  justify-content: center;
}

.login-card {
  border-radius: 8px;
  padding: 26px;
}

.headline {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.subhead {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field label {
  color: #334155;
  font-weight: 800;
  font-size: 0.88rem;
}

.field select,
.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: white;
  color: var(--ink);
}

.primary,
.secondary,
.ghost,
.answer-btn {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 900;
  position: relative;
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.primary {
  width: 100%;
  margin-top: 6px;
  color: white;
  background: linear-gradient(135deg, var(--red), #ff7b2d);
  box-shadow: 0 8px 0 #a51d1f, 0 18px 30px rgba(240, 24, 63, 0.24);
}

.secondary {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--green));
  padding: 0 16px;
  box-shadow: 0 7px 0 #0c3f7f, 0 16px 26px rgba(20, 87, 184, 0.22);
}

.ghost {
  color: var(--blue);
  background: #edf5ff;
  padding: 0 14px;
  border: 1px solid rgba(20, 87, 184, 0.16);
  box-shadow: 0 6px 0 #bfd5f2, 0 14px 22px rgba(20, 87, 184, 0.14);
}

.primary:hover,
.secondary:hover,
.ghost:hover,
.answer-btn:hover {
  transform: translateY(-2px);
}

.primary:hover {
  background: linear-gradient(135deg, #b42318, var(--gold));
  box-shadow: 0 10px 0 #7a1718, 0 22px 34px rgba(240, 24, 63, 0.28);
}

.secondary:hover {
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 9px 0 #08684f, 0 20px 32px rgba(0, 168, 120, 0.26);
}

.ghost:hover {
  color: white;
  background: linear-gradient(135deg, var(--blue), #0f7d9d);
  border-color: transparent;
  box-shadow: 0 8px 0 #0c3f7f, 0 18px 28px rgba(20, 87, 184, 0.2);
}

.primary:active,
.secondary:active,
.ghost:active,
.answer-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(23, 32, 51, 0.28), 0 8px 16px rgba(23, 32, 51, 0.16);
}

.error {
  min-height: 22px;
  color: #b42318;
  font-weight: 800;
}

.feature-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 14px;
}

.feature {
  min-height: 148px;
  padding: 20px;
  border-radius: 8px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.feature strong {
  font-size: 1.28rem;
}

.feature span {
  line-height: 1.35;
}

.feature:nth-child(1) {
  background: linear-gradient(135deg, #1457b8, #00a6d6);
}

.feature:nth-child(2) {
  background: linear-gradient(135deg, #00a878, #7ac943);
}

.feature:nth-child(3) {
  background: linear-gradient(135deg, #f0183f, #ff8a3d);
}

.feature:nth-child(4) {
  background: linear-gradient(135deg, #7a4ff3, #12b5cb);
}

.app-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  width: min(1220px, 100%);
  margin: 0 auto;
}

.student-dashboard {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.screen-panel {
  border-radius: 8px;
  padding: 18px;
}

.sidebar-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.small {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.course-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.course-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  color: #263246;
  background: white;
  border: 1px solid var(--line);
  text-align: left;
  font-weight: 800;
}

.course-btn.active {
  color: white;
  background: linear-gradient(135deg, var(--blue), #00a878);
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.workspace-head h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.05;
}

.badge-row,
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.badge,
.stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
  font-weight: 800;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.topic-card {
  min-height: 168px;
  border-radius: 8px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  gap: 12px;
}

.topic-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.topic-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.topic-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.topic-level-picker {
  display: grid;
  gap: 7px;
}

.topic-level-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.topic-level-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topic-level-btn {
  min-width: 0;
  min-height: 58px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(14, 50, 111, 0.16);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.topic-level-btn:hover,
.topic-level-btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 rgba(14, 50, 111, 0.18);
}

.topic-level-btn strong {
  font-size: 0.96rem;
}

.topic-level-btn small {
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.15;
}

.level-apprentice,
.challenge-level-apprentice {
  color: #0b4d87;
  background: linear-gradient(135deg, #eff8ff, #d8efff);
  border-color: #9ed1f7;
}

.level-master,
.challenge-level-master {
  color: #6b3000;
  background: linear-gradient(135deg, #fff7d7, #ffd991);
  border-color: #f0b94f;
}

.challenge-level-badge {
  width: fit-content;
  margin-top: 9px;
  padding: 5px 9px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.study-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  gap: 16px;
}

.explain-panel h2,
.game-panel h2 {
  margin-top: 0;
}

.explain-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 16px 0;
  list-style: none;
}

.explain-list li {
  padding: 12px;
  border-radius: 8px;
  background: #f7fbff;
  border: 1px solid var(--line);
}

.question-box {
  border-radius: 8px;
  padding: 18px;
}

.geometry-question-statement {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 300px);
  align-items: center;
  gap: 18px;
}

.geometry-question-copy {
  min-width: 0;
}

.geometry-question-figure {
  margin: 0;
  padding: 8px 10px 5px;
  border: 1px solid #b8d5ef;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #edf7ff);
  box-shadow: 0 6px 16px rgba(21, 95, 189, 0.12);
}

.inequality-graph .ineq-grid {
  fill: none;
  stroke: #dce8f5;
  stroke-width: 0.7;
}

.inequality-graph .ineq-axis {
  fill: none;
  stroke: #334e68;
  stroke-width: 1.8;
}

.inequality-graph .ineq-boundary {
  fill: none;
  stroke: #0f5ca8;
  stroke-width: 3;
}

.inequality-graph .ineq-boundary.dashed {
  stroke-dasharray: 8 6;
}

.inequality-graph .ineq-region {
  fill: rgba(39, 174, 96, 0.2);
  stroke: none;
}

.inequality-graph .ineq-region.strong {
  fill: rgba(39, 174, 96, 0.32);
}

.exercise-source-figure {
  display: block;
  width: min(100%, 920px);
  height: auto;
  max-width: 100%;
  margin: 0.75rem auto 0;
  object-fit: contain;
}

.exercise-data-table {
  width: min(100%, 760px);
  margin: 0.8rem auto;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  background: #fff;
}

.exercise-data-table th,
.exercise-data-table td {
  padding: 0.55rem 0.75rem;
  border: 1px solid #a9bfd8;
  text-align: center;
}

.exercise-data-table th {
  background: #edf5ff;
  color: #173d68;
}

.geometry-question-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 175px;
  overflow: visible;
}

.geometry-question-svg .geo-fill {
  fill: rgba(32, 150, 184, 0.14);
  stroke: #155fbd;
  stroke-width: 3;
  stroke-linejoin: round;
}

.geometry-question-svg .geo-line,
.geometry-question-svg .geo-aux,
.geometry-question-svg .geo-strong,
.geometry-question-svg .geo-right {
  fill: none;
  stroke: #155fbd;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.geometry-question-svg .geo-aux {
  stroke: #e08a16;
  stroke-width: 2;
  stroke-dasharray: 6 5;
}

.geometry-question-svg .geo-strong {
  stroke: #e64b61;
  stroke-width: 5;
}

.geometry-question-svg .geo-right {
  stroke: #17233c;
  stroke-width: 2;
}

.geometry-question-svg .geo-grid {
  fill: none;
  stroke: #c9dced;
  stroke-width: 1;
}

.geometry-question-svg .geo-point {
  fill: #e64b61;
  stroke: #ffffff;
  stroke-width: 2;
}

.geometry-question-svg text {
  fill: #17233c;
  font-family: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 900;
  text-anchor: middle;
}

.geometry-question-figure figcaption {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

@media (max-width: 900px) {
  .geometry-question-statement {
    grid-template-columns: 1fr;
  }

  .geometry-question-figure {
    width: min(320px, 100%);
    justify-self: center;
  }
}

.topic-summary-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(20, 87, 184, 0.12), rgba(0, 168, 120, 0.14));
  border: 1px solid var(--line);
}

.topic-kicker {
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.topic-summary-card h3 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
  line-height: 1.08;
}

.topic-summary-card p,
.topic-explanation-detail p {
  margin: 0;
  color: #46536a;
  line-height: 1.5;
}

.topic-explanation-detail {
  display: none;
  gap: 14px;
  margin-top: 14px;
}

.topic-explanation-detail > strong {
  font-size: 1.18rem;
}

.book-explanation {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(20, 87, 184, 0.18);
  box-shadow: 0 12px 24px rgba(20, 87, 184, 0.1);
}

.book-explanation > strong {
  color: var(--blue);
  font-size: 1.08rem;
}

.book-explanation p {
  margin: 0;
  color: #263246;
  line-height: 1.55;
}

.resource-note {
  display: none;
  padding: 10px;
  border-radius: 8px;
  color: #263246;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 87, 184, 0.16);
  font-size: 0.88rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.book-content-panel {
  display: none;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.96));
  border: 1px solid rgba(21, 95, 189, 0.16);
  box-shadow: var(--shadow-tight);
}

.book-content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(21, 95, 189, 0.12);
}

.book-content-head strong {
  color: #111827;
  font-size: 1.08rem;
}

.book-content-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-btn {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.book-explanation-inline {
  max-height: 520px;
  background: #ffffff;
}

.visual-stage {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(20, 87, 184, 0.12), rgba(0, 168, 120, 0.14));
  border: 1px solid var(--line);
}

.visual-stage strong {
  display: block;
  font-size: 1.06rem;
  margin-bottom: 4px;
}

.visual-stage p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.math-orbit {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--line);
  animation: pulseGlow 2.8s ease-in-out infinite;
}

.math-orbit span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  font-weight: 900;
}

.math-orbit span:nth-child(1) {
  left: 22px;
  top: -7px;
  background: var(--red);
}

.math-orbit span:nth-child(2) {
  right: -7px;
  top: 22px;
  background: var(--blue);
}

.math-orbit span:nth-child(3) {
  left: 22px;
  bottom: -7px;
  background: var(--green);
}

.math-orbit span:nth-child(4) {
  left: -7px;
  top: 22px;
  background: var(--gold);
}

@keyframes pulseGlow {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 26px rgba(20, 87, 184, 0.12);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 16px 34px rgba(0, 168, 120, 0.24);
  }
}

.question-text {
  margin: 0 0 14px;
  font-size: 1.28rem;
  font-weight: 900;
  line-height: 1.35;
}

.answers {
  display: grid;
  gap: 10px;
}

.answer-btn {
  padding: 12px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #f1f6ff);
  border: 1px solid rgba(20, 87, 184, 0.16);
  box-shadow: 0 6px 0 #c8d6ea, 0 14px 22px rgba(20, 87, 184, 0.12);
  text-align: left;
}

.answer-btn:hover {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  border-color: transparent;
  box-shadow: 0 8px 0 #0c3f7f, 0 18px 28px rgba(20, 87, 184, 0.2);
}

.answer-btn.correct {
  color: white;
  background: var(--green);
  box-shadow: 0 6px 0 #087a5c, 0 14px 22px rgba(0, 168, 120, 0.2);
}

.answer-btn.wrong {
  color: white;
  background: #e5484d;
  box-shadow: 0 6px 0 #a51d1f, 0 14px 22px rgba(229, 72, 77, 0.2);
}

.feedback {
  min-height: 36px;
  margin-top: 12px;
  font-weight: 900;
}

.solution-help {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  color: #263246;
  background: #fff8df;
  border: 1px solid rgba(246, 183, 60, 0.55);
  line-height: 1.45;
}

.timer-stat {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.timer-warning {
  background: linear-gradient(135deg, #d92d20, #f79009);
  animation: timerBeat 0.7s ease-in-out infinite;
}

@keyframes timerBeat {
  50% {
    transform: scale(1.05);
  }
}

.progress {
  height: 12px;
  border-radius: 99px;
  background: #e8eef7;
  overflow: hidden;
  margin: 12px 0;
}

.progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
  transition: width 0.25s ease;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.admin-table th {
  background: #f2f7ff;
}

.spark {
  position: fixed;
  width: 12px;
  height: 12px;
  pointer-events: none;
  border-radius: 50%;
  background: var(--gold);
  animation: burst 780ms ease-out forwards;
  z-index: 10;
}

@keyframes burst {
  from {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(var(--x), var(--y)) scale(0.2);
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .login-layout,
  .app-grid,
  .study-layout {
    grid-template-columns: 1fr;
  }

  .top-strip {
    align-items: center;
    display: flex;
    padding: 72px 12px 12px;
  }

  .site-title {
    max-width: none;
    font-size: clamp(1.4rem, 5vw, 2.3rem);
  }

  .brand-main {
    flex-direction: column;
    gap: 8px;
  }

  .school-logo {
    width: clamp(150px, 38vw, 230px);
  }

  .corner-logo {
    width: 58px;
  }

  .corner-logo-right {
    width: 78px;
  }

  .math-word {
    font-size: clamp(1.5rem, 8vw, 3rem);
  }

  .student-pill {
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 12px;
  }

  .feature-board,
  .topic-grid {
    grid-template-columns: 1fr;
  }

  .workspace-head {
    flex-direction: column;
  }
}

/* Learning studio refresh */
:root {
  --ink: #172033;
  --ink-soft: #344054;
  --muted: #59667a;
  --line: rgba(23, 32, 51, 0.12);
  --panel: rgba(255, 255, 255, 0.94);
  --paper: #fbfdff;
  --blue: #155fbd;
  --blue-deep: #0b3474;
  --green: #009f7a;
  --gold: #f2b034;
  --red: #e92b4f;
  --violet: #7257e8;
  --sky: #e8f3ff;
  --mint: #e7fbf4;
  --rose: #fff0f3;
  --shadow: 0 20px 46px rgba(20, 43, 88, 0.14);
  --shadow-tight: 0 0 0 1px rgba(23, 32, 51, 0.08), 0 12px 24px rgba(20, 43, 88, 0.11);
  --lift: 0 0 0 1px rgba(255, 255, 255, 0.75), 0 18px 36px rgba(20, 43, 88, 0.13);
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    linear-gradient(rgba(21, 95, 189, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 95, 189, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #f7fbff 0%, #ffffff 44%, #f1fff8 100%);
  background-size: 34px 34px, 34px 34px, auto;
}

body::before {
  content: "∑  π  √  x²  ∫  %  Δ  =";
  bottom: 18px;
  color: rgba(21, 95, 189, 0.06);
  font-size: clamp(2.4rem, 8vw, 6.8rem);
  letter-spacing: 14px;
}

.shell {
  padding: clamp(14px, 2vw, 26px);
}

.top-strip,
.login-card,
.screen-panel,
.topic-card,
.question-box,
.admin-table {
  background: var(--panel);
  border: 1px solid rgba(23, 32, 51, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.top-strip {
  min-height: 112px;
  border-radius: var(--radius);
  box-shadow: var(--lift);
  overflow: hidden;
}

.top-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(21, 95, 189, 0.1), transparent 28%),
    linear-gradient(270deg, rgba(0, 159, 122, 0.12), transparent 28%);
}

.site-title {
  color: #111827;
  font-size: clamp(1.55rem, 2.8vw, 3.1rem);
  letter-spacing: 0;
}

.math-word {
  font-size: clamp(1.45rem, 3vw, 3.5rem);
  text-shadow: none;
}

.math-word span {
  animation: mathFloat 3.2s var(--ease) infinite;
}

@keyframes mathFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-5px);
  }
}

.student-pill {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  box-shadow: 0 10px 22px rgba(21, 95, 189, 0.2);
}

.login-layout {
  align-items: center;
}

.login-card {
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 34px);
}

.headline,
.workspace-head h1 {
  color: #111827;
  text-wrap: balance;
}

.subhead,
.small,
.topic-card p,
.topic-summary-card p,
.topic-explanation-detail p {
  color: var(--muted);
}

.field select,
.field input {
  min-height: 48px;
  border-radius: var(--radius-sm);
  border-color: rgba(21, 95, 189, 0.18);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(20, 43, 88, 0.03);
}

.field select:focus,
.field input:focus {
  outline: 3px solid rgba(21, 95, 189, 0.22);
  border-color: rgba(21, 95, 189, 0.55);
}

.primary,
.secondary,
.ghost,
.answer-btn,
.course-btn {
  border-radius: var(--radius-sm);
  transition: transform 170ms var(--ease), box-shadow 170ms var(--ease), background 170ms var(--ease), color 170ms var(--ease), border-color 170ms var(--ease);
}

.primary,
.secondary {
  min-height: 48px;
}

.primary {
  background: linear-gradient(135deg, var(--red), #f47b38);
  box-shadow: 0 6px 0 #9d1830, 0 16px 28px rgba(233, 43, 79, 0.22);
}

.secondary {
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 6px 0 #0b3474, 0 16px 28px rgba(21, 95, 189, 0.2);
}

.ghost {
  color: var(--blue);
  background: #edf5ff;
  box-shadow: 0 5px 0 #c5d9f4, 0 12px 20px rgba(21, 95, 189, 0.12);
}

.primary:focus-visible,
.secondary:focus-visible,
.ghost:focus-visible,
.answer-btn:focus-visible,
.course-btn:focus-visible {
  outline: 3px solid rgba(242, 176, 52, 0.48);
  outline-offset: 3px;
}

.app-grid {
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  width: min(1320px, 100%);
  gap: clamp(14px, 2vw, 22px);
}

.student-dashboard {
  width: min(1180px, 100%);
}

.screen-panel {
  border-radius: var(--radius);
  padding: clamp(16px, 2vw, 22px);
}

.workspace-head {
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(21, 95, 189, 0.12);
}

.badge,
.stat {
  min-height: 36px;
  border-radius: 999px;
  background: #ffffff;
  border-color: rgba(21, 95, 189, 0.14);
  box-shadow: 0 6px 14px rgba(20, 43, 88, 0.06);
  font-variant-numeric: tabular-nums;
}

.topic-grid {
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 14px;
}

.topic-card {
  position: relative;
  min-height: 188px;
  padding: 18px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-tight);
  --topic-accent: var(--blue);
  --topic-accent-2: var(--green);
  transform: translateY(0);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

.topic-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--topic-accent), var(--topic-accent-2), var(--gold));
  z-index: 2;
}

.topic-card::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 50px;
  width: 142px;
  height: 104px;
  border-radius: 14px;
  opacity: 0.16;
  color: var(--topic-accent);
  pointer-events: none;
  z-index: 0;
  transform: rotate(-3deg);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.topic-card > * {
  position: relative;
  z-index: 1;
}

.topic-card:hover {
  transform: translateY(-4px);
  border-color: rgba(21, 95, 189, 0.22);
  box-shadow: 0 0 0 1px rgba(21, 95, 189, 0.1), 0 18px 34px rgba(20, 43, 88, 0.16);
}

.topic-card:hover::after {
  opacity: 0.23;
  transform: rotate(-1deg) translateY(-3px);
}

.topic-visual-matrix,
.topic-visual-cramer,
.topic-visual-sarrus {
  --topic-accent: var(--blue);
  --topic-accent-2: #16a0d8;
}

.topic-visual-function,
.topic-visual-linear-function,
.topic-visual-linear-programming,
.topic-visual-limit,
.topic-visual-derivative,
.topic-visual-optimization,
.topic-visual-integral,
.topic-visual-definite-integral {
  --topic-accent: #0f7d9d;
  --topic-accent-2: var(--green);
}

.topic-visual-probability,
.topic-visual-distribution,
.topic-visual-statistics,
.topic-visual-combinatorics,
.topic-visual-inference {
  --topic-accent: #7c5cdb;
  --topic-accent-2: var(--gold);
}

.topic-visual-geometry,
.topic-visual-vectors,
.topic-visual-planes,
.topic-visual-metrics,
.topic-visual-conics,
.topic-visual-polygon,
.topic-visual-angles,
.topic-visual-pythagoras,
.topic-visual-solids,
.topic-visual-area-volume,
.topic-visual-similarity,
.topic-visual-trigonometry {
  --topic-accent: #0d8b70;
  --topic-accent-2: #2cbec5;
}

.topic-visual-matrix::after {
  background:
    linear-gradient(currentColor 0 0) 24px 18px / 18px 12px,
    linear-gradient(currentColor 0 0) 58px 18px / 18px 12px,
    linear-gradient(currentColor 0 0) 92px 18px / 18px 12px,
    linear-gradient(currentColor 0 0) 24px 48px / 18px 12px,
    linear-gradient(currentColor 0 0) 58px 48px / 18px 12px,
    linear-gradient(currentColor 0 0) 92px 48px / 18px 12px,
    linear-gradient(currentColor 0 0) 24px 78px / 18px 12px,
    linear-gradient(currentColor 0 0) 58px 78px / 18px 12px,
    linear-gradient(currentColor 0 0) 92px 78px / 18px 12px,
    linear-gradient(currentColor 0 0) left 8px top 8px / 5px 88px,
    linear-gradient(currentColor 0 0) right 8px top 8px / 5px 88px;
  background-repeat: no-repeat;
}

.topic-visual-sarrus::after {
  content: "a  b  c\A d  e  f\A g  h  i";
  white-space: pre;
  width: 150px;
  height: 105px;
  padding: 16px 16px 12px;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  line-height: 1.35;
  background:
    linear-gradient(42deg, transparent 44%, currentColor 45% 48%, transparent 49%),
    linear-gradient(138deg, transparent 44%, currentColor 45% 48%, transparent 49%);
}

.topic-visual-cramer::after {
  content: "Δx/Δ\A Δy/Δ\A Δz/Δ";
  white-space: pre;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.1;
  padding: 18px;
  border: 3px solid currentColor;
  background: radial-gradient(circle at 78% 24%, currentColor 0 6px, transparent 7px);
}

.topic-visual-function::after,
.topic-visual-linear-function::after,
.topic-visual-limit::after,
.topic-visual-derivative::after,
.topic-visual-optimization::after {
  background:
    linear-gradient(currentColor 0 0) 16px 80px / 112px 3px,
    linear-gradient(currentColor 0 0) 32px 12px / 3px 80px,
    radial-gradient(circle at 34px 80px, currentColor 0 4px, transparent 5px),
    radial-gradient(circle at 62px 56px, currentColor 0 4px, transparent 5px),
    radial-gradient(circle at 92px 36px, currentColor 0 4px, transparent 5px),
    radial-gradient(circle at 120px 28px, currentColor 0 4px, transparent 5px);
}

.topic-visual-linear-function::after {
  background:
    linear-gradient(currentColor 0 0) 16px 80px / 112px 3px,
    linear-gradient(currentColor 0 0) 32px 12px / 3px 80px,
    linear-gradient(145deg, transparent 44%, currentColor 45% 48%, transparent 49%);
}

.topic-visual-linear-programming::after {
  background:
    linear-gradient(currentColor 0 0) 16px 84px / 112px 3px,
    linear-gradient(currentColor 0 0) 30px 14px / 3px 78px,
    linear-gradient(132deg, transparent 37%, currentColor 38% 41%, transparent 42%),
    linear-gradient(35deg, transparent 48%, currentColor 49% 52%, transparent 53%),
    linear-gradient(135deg, color-mix(in srgb, currentColor 34%, transparent), color-mix(in srgb, currentColor 10%, transparent));
  clip-path: polygon(8% 92%, 8% 8%, 88% 8%, 88% 92%);
}

.topic-visual-limit::after {
  content: "lim\A x→a";
  white-space: pre;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 900;
  line-height: 0.95;
  padding: 22px;
  background: radial-gradient(circle at 96px 52px, currentColor 0 7px, transparent 8px);
}

.topic-visual-derivative::after {
  content: "f'(x)\A ↗";
  white-space: pre;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  padding: 22px;
}

.topic-visual-optimization::after {
  content: "max\A f'(x)=0";
  white-space: pre;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.08;
  padding: 22px;
}

.topic-visual-integral::after,
.topic-visual-definite-integral::after {
  content: "∫ f(x) dx";
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.15rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.topic-visual-definite-integral::after {
  content: "∫ₐᵇ f(x) dx";
}

.topic-visual-probability::after,
.topic-visual-distribution::after,
.topic-visual-statistics::after {
  background:
    radial-gradient(circle at 28px 28px, currentColor 0 7px, transparent 8px),
    radial-gradient(circle at 78px 28px, currentColor 0 7px, transparent 8px),
    radial-gradient(circle at 118px 28px, currentColor 0 7px, transparent 8px),
    linear-gradient(currentColor 0 0) 26px 76px / 20px 28px,
    linear-gradient(currentColor 0 0) 62px 58px / 20px 46px,
    linear-gradient(currentColor 0 0) 98px 40px / 20px 64px;
  background-repeat: no-repeat;
}

.topic-visual-distribution::after {
  background:
    radial-gradient(ellipse at 72px 78px, transparent 0 30px, currentColor 31px 34px, transparent 35px),
    linear-gradient(currentColor 0 0) 16px 84px / 112px 3px;
  background-repeat: no-repeat;
}

.topic-visual-combinatorics::after {
  content: "n!\A C(n,k)";
  white-space: pre;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.04;
  padding: 22px;
}

.topic-visual-inference::after {
  content: "x̄ ± E\A n = 50\A IC 95%";
  white-space: pre;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.42rem;
  font-weight: 900;
  line-height: 1.12;
  padding: 18px;
  border: 4px solid currentColor;
  background:
    radial-gradient(circle at 104px 28px, currentColor 0 6px, transparent 7px),
    linear-gradient(currentColor 0 0) 20px 82px / 96px 3px;
}

.topic-visual-vectors::after,
.topic-visual-planes::after,
.topic-visual-metrics::after,
.topic-visual-angles::after,
.topic-visual-polygon::after,
.topic-visual-pythagoras::after,
.topic-visual-solids::after,
.topic-visual-area-volume::after,
.topic-visual-similarity::after,
.topic-visual-trigonometry::after,
.topic-visual-conics::after {
  background:
    linear-gradient(currentColor 0 0) 18px 82px / 108px 3px,
    linear-gradient(currentColor 0 0) 34px 18px / 3px 76px,
    linear-gradient(140deg, transparent 43%, currentColor 44% 48%, transparent 49%),
    radial-gradient(circle at 102px 35px, currentColor 0 5px, transparent 6px);
}

.topic-visual-vectors::after {
  content: "u⃗\A   v⃗";
  white-space: pre;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
  padding: 18px;
  background:
    linear-gradient(28deg, transparent 46%, currentColor 47% 51%, transparent 52%),
    linear-gradient(28deg, transparent 46%, currentColor 47% 51%, transparent 52%) 28px 34px / 86px 32px no-repeat,
    linear-gradient(135deg, transparent 50%, currentColor 51% 56%, transparent 57%) 102px 24px / 22px 22px no-repeat,
    linear-gradient(135deg, transparent 50%, currentColor 51% 56%, transparent 57%) 92px 58px / 22px 22px no-repeat;
}

.topic-visual-planes::after {
  content: "π";
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.2rem;
  font-weight: 900;
  transform: rotate(-7deg) skew(-10deg);
  border: 5px solid currentColor;
  background:
    linear-gradient(24deg, transparent 46%, currentColor 47% 50%, transparent 51%),
    linear-gradient(156deg, transparent 46%, currentColor 47% 50%, transparent 51%);
}

.topic-visual-metrics::after {
  content: "d(P,π)";
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 900;
  background:
    radial-gradient(circle at 30px 28px, currentColor 0 6px, transparent 7px),
    linear-gradient(128deg, transparent 45%, currentColor 46% 50%, transparent 51%),
    linear-gradient(currentColor 0 0) 40px 76px / 88px 4px;
}

.topic-visual-pythagoras::after {
  clip-path: polygon(18% 82%, 18% 18%, 82% 82%);
  border: 6px solid currentColor;
  background: transparent;
}

.topic-visual-polygon::after {
  clip-path: polygon(50% 6%, 92% 34%, 78% 88%, 22% 88%, 8% 34%);
  border: 7px solid currentColor;
  background: transparent;
}

.topic-visual-solids::after {
  border: 5px solid currentColor;
  transform: rotate(-8deg) skew(-8deg);
  background: linear-gradient(135deg, transparent 48%, currentColor 49% 52%, transparent 53%);
}

.topic-visual-trigonometry::after {
  content: "sen\A cos\A tg";
  white-space: pre;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
  padding: 18px;
  background: conic-gradient(from 210deg at 84px 78px, transparent 0 52deg, currentColor 53deg 58deg, transparent 59deg);
}

.topic-visual-conics::after {
  border: 6px solid currentColor;
  border-radius: 50%;
  transform: rotate(-18deg);
}

.topic-visual-natural::after,
.topic-visual-divisibility::after,
.topic-visual-integer::after,
.topic-visual-fraction::after,
.topic-visual-decimal::after,
.topic-visual-ratio::after,
.topic-visual-real::after,
.topic-visual-powers::after,
.topic-visual-complex::after,
.topic-visual-algebra::after,
.topic-visual-equation::after,
.topic-visual-inequality::after,
.topic-visual-math::after {
  content: "1 2 3\A + − ×\A x²";
  white-space: pre;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1.05;
  padding: 20px;
}

.topic-visual-divisibility::after { content: "m.c.d.\A 2·3·5"; }
.topic-visual-integer::after { content: "−3  0  +4"; }
.topic-visual-fraction::after { content: "3/4\A 5/8"; }
.topic-visual-decimal::after { content: "0,25\A 1,75"; }
.topic-visual-ratio::after { content: "a/b = c/d"; }
.topic-visual-real::after { content: "ℝ\A √2  π"; }
.topic-visual-powers::after { content: "x²\A √a\A log"; }
.topic-visual-complex::after { content: "a+bi\A Im ↑"; }
.topic-visual-algebra::after { content: "x²+bx+c"; }
.topic-visual-equation::after { content: "2x+3=7"; }
.topic-visual-inequality::after { content: "x²−1 ≥ 0"; }

.home-panel {
  overflow: hidden;
}

.path-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px;
}

.path-choice {
  min-height: 320px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: clamp(20px, 3vw, 30px);
  border-radius: var(--radius);
  color: #111827;
  border: 1px solid rgba(21, 95, 189, 0.12);
  box-shadow: var(--shadow-tight);
}

.path-choice h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.05;
  text-wrap: balance;
}

.path-choice p {
  margin: 0;
  max-width: 58ch;
  color: #344054;
  line-height: 1.55;
}

.path-choice-study {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.92), rgba(232,243,255,0.86)),
    #ffffff;
}

.path-choice-adventure {
  color: white;
  background:
    radial-gradient(circle at 18% 15%, rgba(242,176,52,0.34), transparent 28%),
    linear-gradient(135deg, #0b3474, #155fbd 48%, #009f7a);
}

.path-choice-exam {
  color: #ffffff;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 219, 112, 0.34), transparent 30%),
    linear-gradient(135deg, #4c1d95, #7c3aed 50%, #155fbd);
}

.path-choice-exam p,
.path-choice-exam .path-icon {
  color: #ffffff;
}

.bach-ii-home-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-height: min(650px, calc(100vh - 310px));
}

.bach-ii-home-grid .path-choice {
  min-height: 0;
}

.bach-home-topics {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.bach-home-blocks {
  grid-column: 2;
  grid-row: 1;
}

.bach-home-exam {
  grid-column: 2;
  grid-row: 2;
}

.first-bach-home-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-height: min(650px, calc(100vh - 310px));
}

.eso-home-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  min-height: min(650px, calc(100vh - 310px));
}

.eso-home-grid .path-choice {
  min-height: 0;
}

.eso-home-study {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.eso-home-coach {
  grid-column: 2;
  grid-row: 1;
}

.eso-home-exam {
  grid-column: 2;
  grid-row: 2;
}

.eso-home-coach,
.eso-home-exam {
  gap: 7px;
  padding: clamp(12px, 1.6vw, 18px);
}

.eso-home-coach h2,
.eso-home-exam h2 {
  font-size: clamp(1.45rem, 2.4vw, 2.15rem);
}

.eso-home-coach p,
.eso-home-exam p {
  line-height: 1.35;
}

.first-bach-home-grid .path-choice {
  min-height: 0;
}

.first-bach-home-topics {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.first-bach-home-coach {
  grid-column: 2;
  grid-row: 1;
}

.first-bach-home-exam {
  grid-column: 2;
  grid-row: 2;
}

.first-bach-home-coach,
.first-bach-home-exam {
  gap: 7px;
  padding: clamp(12px, 1.6vw, 18px);
}

.first-bach-home-coach h2,
.first-bach-home-exam h2 {
  font-size: clamp(1.45rem, 2.4vw, 2.15rem);
}

.first-bach-home-coach p,
.first-bach-home-exam p {
  line-height: 1.35;
}

.first-bach-exam-setup {
  display: grid;
  gap: 18px;
}

.first-bach-exam-config {
  display: grid;
  grid-template-columns: minmax(245px, 0.72fr) minmax(0, 1.7fr);
  gap: 16px;
}

.first-bach-exam-count-card,
.first-bach-exam-topics-card {
  padding: 20px;
  border: 1px solid rgba(21, 95, 189, 0.18);
  border-radius: 22px;
  background: linear-gradient(145deg, #ffffff, #f1f7ff);
  box-shadow: var(--shadow-tight);
}

.first-bach-exam-count-card {
  display: grid;
  align-content: start;
  gap: 16px;
}

.first-bach-exam-count-card h2,
.first-bach-exam-topics-card h2 {
  margin: 0;
  color: #13223b;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.first-bach-exam-count-card p,
.first-bach-exam-topics-card p,
.first-bach-exam-start-row p {
  margin: 0;
  color: #52637e;
  line-height: 1.45;
}

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

.eso-exam-count-options {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.first-bach-count-options button {
  min-height: 64px;
  border: 2px solid #bcd4ef;
  border-radius: 16px;
  color: #164b89;
  background: #fff;
  font-size: 1rem;
  font-weight: 950;
}

.first-bach-count-options button.is-selected {
  border-color: #6d28d9;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #155fbd);
  box-shadow: 0 5px 0 #4c1d95;
}

.first-bach-exam-topics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.first-bach-topic-actions {
  display: flex;
  gap: 8px;
}

.first-bach-topic-actions .ghost {
  min-height: 42px;
  padding: 8px 12px;
}

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

.first-bach-topic-toggle {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 8px 12px;
  border: 2px solid #c9dbee;
  border-radius: 15px;
  color: #243653;
  background: #fff;
  text-align: left;
}

.first-bach-topic-toggle > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: #155fbd;
  background: #e8f2ff;
  font-weight: 950;
}

.first-bach-topic-toggle > strong {
  font-size: 0.9rem;
  line-height: 1.18;
}

.first-bach-topic-toggle.is-selected {
  border-color: #009f7a;
  background: linear-gradient(135deg, #e7fff7, #fff);
  box-shadow: 0 4px 0 rgba(0, 120, 90, 0.28);
}

.first-bach-topic-toggle.is-selected > span {
  color: #fff;
  background: #009f7a;
}

.first-bach-exam-start-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #edf5ff;
}

.first-bach-exam-start-row .primary {
  flex: 0 0 auto;
}

.eso-exam-start-row {
  justify-content: center;
}

.eso-exam-start-row .primary {
  width: min(100%, 760px);
}

.first-bach-exam-question {
  display: grid;
  gap: 16px;
}

.first-bach-exam-statement {
  padding: clamp(18px, 2vw, 28px);
  border: 2px solid #c9dbee;
  border-radius: 20px;
  color: #111827;
  background: #f5f9ff;
  font-size: clamp(1.12rem, 1.55vw, 1.42rem);
  font-weight: 850;
  line-height: 1.55;
}

.first-bach-exam-instruction {
  margin: 0;
  color: #52637e;
  font-size: 1.06rem;
}

.first-bach-exam-controls,
.first-bach-exam-result-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.first-bach-exam-result {
  display: grid;
  justify-items: center;
  gap: 18px;
  min-height: min(570px, calc(100vh - 300px));
  align-content: center;
  text-align: center;
}

.first-bach-exam-result h1,
.first-bach-exam-result p {
  margin: 0;
}

.first-bach-exam-result-score {
  display: grid;
  width: 190px;
  height: 190px;
  place-items: center;
  border: 10px solid #d9e9fb;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #155fbd, #009f7a);
  box-shadow: 0 12px 30px rgba(21, 95, 189, 0.24);
  font-size: 3.4rem;
  font-weight: 950;
}

@media (max-width: 900px) {
  .eso-home-grid,
  .first-bach-home-grid,
  .first-bach-exam-config {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .first-bach-home-topics,
  .first-bach-home-coach,
  .first-bach-home-exam {
    grid-column: 1;
    grid-row: auto;
  }

  .eso-home-study,
  .eso-home-coach,
  .eso-home-exam {
    grid-column: 1;
    grid-row: auto;
  }

  .first-bach-topic-selector {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .first-bach-exam-topics-head,
  .first-bach-exam-start-row,
  .first-bach-exam-controls,
  .first-bach-exam-result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .eso-exam-count-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.bach-home-blocks h2,
.bach-home-exam h2 {
  font-size: clamp(1.45rem, 2.4vw, 2.15rem);
}

.bach-home-blocks,
.bach-home-exam {
  padding: clamp(12px, 1.6vw, 18px);
  gap: 7px;
}

.bach-home-blocks .path-icon,
.bach-home-exam .path-icon {
  padding: 6px 10px;
  font-size: 0.86rem;
}

.bach-home-blocks p,
.bach-home-exam p {
  font-size: clamp(0.85rem, 1.05vw, 1rem);
  line-height: 1.3;
}

.bach-home-blocks .secondary,
.bach-home-exam .secondary {
  min-height: 36px;
  padding: 7px 15px;
}

.bach-exam-screen,
.bach-exam-panel {
  width: 100%;
  max-width: 100%;
}

.bach-exam-panel {
  display: grid;
  gap: 16px;
}

.exam-workspace-head {
  align-items: start;
}

.exam-workspace-head h1 {
  margin: 4px 0 0;
  font-size: clamp(1.55rem, 2.8vw, 2.5rem);
}

.exam-heading-copy {
  min-width: 0;
}

.exam-summary-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.exam-summary-line h1 {
  font-size: clamp(1.35rem, 2.15vw, 2rem);
  line-height: 1.12;
}

.exam-summary-line .topic-kicker {
  flex: 0 0 auto;
}

.exam-summary-line .badge {
  flex: 0 0 auto;
}

.exam-countdown {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.exam-final-grade {
  color: #0b2b70;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
}

.exam-progress {
  width: 100%;
}

.exam-question-card {
  display: grid;
  gap: 18px;
  padding: clamp(16px, 2.5vw, 28px);
  border: 1px solid rgba(21, 95, 189, 0.16);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--shadow-tight);
}

.official-source {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  color: #0b3474;
  background: #eaf3ff;
  font-size: 0.85rem;
  font-weight: 800;
}

.bach-exam-screen .official-source,
.bach-block-challenge .official-source,
.bach-topic-challenge .official-source {
  font-size: clamp(1rem, 1.15vw, 1.3rem);
  padding: 0.55rem 0.9rem;
}

.exam-parts {
  display: grid;
  gap: 18px;
}

.exam-part {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #dce8f7;
}

.exam-part:first-child {
  padding-top: 0;
  border-top: 0;
}

.exam-part-prompt p {
  margin: 0 0 8px;
  line-height: 1.55;
}

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

.answer-btn.is-selected:not(.correct):not(.wrong) {
  border: 4px solid #6d28d9;
  background: linear-gradient(135deg, #f4edff, #ffffff 72%);
  box-shadow:
    0 0 0 5px rgba(124, 58, 237, 0.22),
    0 8px 0 #5b21b6,
    0 15px 28px rgba(91, 33, 182, 0.24);
  transform: translateY(-3px);
}

.answer-btn.is-selected:not(.correct):not(.wrong) .answer-letter {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  box-shadow: 0 4px 0 #4c1d95;
}

.answer-btn.is-selected:not(.correct):not(.wrong)::after {
  content: "✓ Seleccionada";
  position: absolute;
  top: 8px;
  right: 12px;
  color: #5b21b6;
  font-size: 0.72rem;
  font-weight: 950;
}

.exam-solution {
  display: block;
  margin-top: 4px;
}

.exam-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.bach-exam-result {
  width: min(760px, 100%);
  margin: auto;
  display: grid;
  justify-items: center;
  gap: 20px;
  text-align: center;
}

.exam-result-score {
  display: grid;
  color: #155fbd;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 1;
}

.exam-result-score small {
  margin-top: 8px;
  color: #344054;
  font-size: 1rem;
  font-weight: 700;
}

.path-choice-adventure p {
  color: rgba(255, 255, 255, 0.88);
}

.path-icon {
  justify-self: start;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--blue-deep);
  font-weight: 900;
}

.path-choice-adventure .path-icon,
.path-choice-adventure .mini-stats span {
  color: white;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mini-stats,
.reward-list,
.teacher-prep {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-stats span,
.reward-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 900;
  background: #ffffff;
  border: 1px solid rgba(21, 95, 189, 0.14);
}

.adventure-shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 20px;
}

.avatar-panel {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(11,52,116,0.1), rgba(255,255,255,0.96) 42%),
    #ffffff;
}

.avatar-core {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.avatar-core h2,
.avatar-core p {
  margin: 0;
}

.avatar-core p,
.smart-review p,
.map-zone p,
.phase-card p {
  color: var(--muted);
  line-height: 1.5;
}

.avatar-circle {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 1.7rem;
  font-weight: 950;
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,0.32), transparent 24%),
    linear-gradient(135deg, var(--blue-deep), var(--green));
  box-shadow: 0 18px 34px rgba(21, 95, 189, 0.24);
}

.avatar-name {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  color: #0b3474;
  background: #edf5ff;
  font-weight: 950;
}

.avatar-figure {
  --avatar-main: var(--blue);
  --avatar-dark: #0b3474;
  --hair: #3b2416;
  --cloth: var(--blue);
  --cloth-dark: #0b3474;
  position: relative;
  width: 104px;
  height: 126px;
}

.avatar-scene {
  position: absolute;
  inset: -10px -12px 0;
  border-radius: 30px;
  background:
    radial-gradient(circle at 78% 22%, rgba(255,255,255,0.75) 0 8px, transparent 9px),
    linear-gradient(180deg, #dff0ff 0 58%, #bfe8d4 59% 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.7);
  z-index: 0;
}

.avatar-scene::before,
.avatar-scene::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.avatar-large {
  width: 142px;
  height: 172px;
}

.avatar-large .avatar-scene {
  inset: -18px -22px 0;
  border-radius: 38px;
}

.avatar-bg-forest .avatar-scene {
  background:
    radial-gradient(circle at 76% 18%, rgba(255,255,255,0.8) 0 9px, transparent 10px),
    radial-gradient(circle at 24% 46%, #2f9e64 0 13px, transparent 14px),
    radial-gradient(circle at 78% 46%, #1b7f53 0 16px, transparent 17px),
    linear-gradient(180deg, #cceeff 0 56%, #74c69d 57% 100%);
}

.avatar-bg-forest .avatar-scene::before {
  left: 22px;
  bottom: 25px;
  width: 8px;
  height: 42px;
  border-radius: 5px;
  background: #7a4a2a;
  box-shadow: 66px -2px 0 #7a4a2a;
}

.avatar-bg-tower .avatar-scene {
  background:
    linear-gradient(90deg, transparent 0 34%, rgba(38,84,160,0.3) 35% 65%, transparent 66%),
    linear-gradient(90deg, transparent 0 42%, #f6b73c 43% 46%, transparent 47% 53%, #f6b73c 54% 57%, transparent 58%),
    repeating-linear-gradient(180deg, transparent 0 18px, rgba(38,84,160,0.18) 19px 22px),
    linear-gradient(180deg, #ddeaff 0 60%, #d9e4f8 61% 100%);
}

.avatar-bg-tower .avatar-scene::before {
  left: 46px;
  top: 18px;
  width: 38px;
  height: 28px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #2654a0;
}

.avatar-bg-observatory .avatar-scene {
  background:
    radial-gradient(circle at 24% 24%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 72% 16%, #fff 0 3px, transparent 4px),
    radial-gradient(circle at 58% 34%, #fff 0 2px, transparent 3px),
    linear-gradient(180deg, #243b73 0 58%, #6aa9d8 59% 100%);
}

.avatar-bg-observatory .avatar-scene::before {
  left: 26px;
  bottom: 28px;
  width: 54px;
  height: 30px;
  border-radius: 30px 30px 6px 6px;
  background: #e7f1ff;
  box-shadow: inset 0 -6px 0 rgba(38,84,160,0.18);
}

.avatar-bg-observatory .avatar-scene::after {
  right: 20px;
  bottom: 26px;
  width: 28px;
  height: 10px;
  border-radius: 999px;
  background: #172033;
  transform: rotate(-24deg);
}

.avatar-bg-castle .avatar-scene {
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(89,113,162,0.42) 19% 34%, transparent 35% 65%, rgba(89,113,162,0.42) 66% 81%, transparent 82%),
    linear-gradient(90deg, transparent 0 38%, rgba(89,113,162,0.48) 39% 61%, transparent 62%),
    linear-gradient(180deg, #dce9ff 0 55%, #bac7df 56% 100%);
}

.avatar-bg-castle .avatar-scene::before {
  left: 20px;
  right: 20px;
  bottom: 28px;
  height: 24px;
  background:
    repeating-linear-gradient(90deg, #7180a0 0 9px, #8d9bb8 9px 18px);
  clip-path: polygon(0 35%, 12% 35%, 12% 0, 25% 0, 25% 35%, 38% 35%, 38% 0, 51% 0, 51% 35%, 64% 35%, 64% 0, 77% 0, 77% 35%, 100% 35%, 100% 100%, 0 100%);
}

.avatar-bg-lab .avatar-scene {
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(255,255,255,0.7) 19% 21%, transparent 22% 78%, rgba(255,255,255,0.7) 79% 81%, transparent 82%),
    linear-gradient(180deg, #dff0ff 0 55%, #d6e7f8 56% 100%);
}

.avatar-bg-lab .avatar-scene::before {
  left: 16px;
  right: 16px;
  bottom: 28px;
  height: 16px;
  border-radius: 7px;
  background: #2a6fbb;
  box-shadow: 0 -18px 0 -4px rgba(15,159,122,0.8);
}

.avatar-bg-lab .avatar-scene::after {
  right: 24px;
  bottom: 47px;
  width: 16px;
  height: 22px;
  border-radius: 4px 4px 9px 9px;
  background:
    linear-gradient(180deg, transparent 0 35%, #0f9f7a 36% 100%);
  border: 2px solid #0b3474;
}

.avatar-color-green {
  --avatar-main: var(--green);
  --avatar-dark: #087a5c;
}

.avatar-color-red {
  --avatar-main: var(--red);
  --avatar-dark: #9d1830;
}

.avatar-color-gold {
  --avatar-main: var(--gold);
  --avatar-dark: #9f6b0f;
}

.avatar-color-violet {
  --avatar-main: var(--violet);
  --avatar-dark: #4930a8;
}

.avatar-hair-color-blonde {
  --hair: #dba936;
}

.avatar-hair-color-brown {
  --hair: #3b2416;
}

.avatar-hair-color-redhead {
  --hair: #a94724;
}

.avatar-face {
  position: absolute;
  left: 50%;
  top: 12px;
  width: 70px;
  height: 70px;
  transform: translateX(-50%);
  border-radius: 24px 24px 28px 28px;
  background: #fff7e8;
  border: 3px solid var(--avatar-dark);
  box-shadow: 0 10px 22px rgba(20, 43, 88, 0.16);
  z-index: 4;
}

.avatar-neck {
  position: absolute;
  left: 50%;
  top: 72px;
  width: 28px;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 0 0 12px 12px;
  background: #fff0d6;
  border: 3px solid var(--avatar-dark);
  border-top: 0;
  z-index: 3;
}

.avatar-large .avatar-neck {
  top: 98px;
  width: 38px;
  height: 28px;
}

.avatar-shoulders {
  position: absolute;
  left: 50%;
  bottom: 47px;
  width: 96px;
  height: 30px;
  transform: translateX(-50%);
  border-radius: 28px 28px 12px 12px;
  background: linear-gradient(180deg, var(--avatar-main), var(--avatar-dark));
  z-index: 2;
}

.avatar-large .avatar-shoulders {
  bottom: 64px;
  width: 130px;
  height: 40px;
  border-radius: 36px 36px 16px 16px;
}

.avatar-hair {
  position: absolute;
  left: 50%;
  top: 3px;
  width: 80px;
  height: 52px;
  transform: translateX(-50%);
  border-radius: 34px 34px 22px 22px;
  background: var(--hair);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.12);
  z-index: 3;
  pointer-events: none;
}

.avatar-large .avatar-hair {
  top: 0;
  width: 108px;
  height: 68px;
  border-radius: 42px 42px 28px 28px;
}

.avatar-hair-short .avatar-hair {
  height: 34px;
  border-radius: 34px 34px 10px 10px;
}

.avatar-large.avatar-hair-short .avatar-hair {
  height: 46px;
}

.avatar-hair-long .avatar-hair {
  height: 42px;
  border-radius: 36px 36px 16px 16px;
}

.avatar-large.avatar-hair-long .avatar-hair {
  height: 56px;
}

.avatar-hair-long .avatar-hair::before,
.avatar-hair-long .avatar-hair::after {
  content: "";
  position: absolute;
  top: 26px;
  width: 18px;
  height: 62px;
  border-radius: 999px 999px 12px 12px;
  background: var(--hair);
  box-shadow: inset -3px -8px 0 rgba(0,0,0,0.12);
}

.avatar-hair-long .avatar-hair::before {
  left: 2px;
  transform: rotate(4deg);
}

.avatar-hair-long .avatar-hair::after {
  right: 2px;
  transform: rotate(-4deg);
}

.avatar-large.avatar-hair-long .avatar-hair::before,
.avatar-large.avatar-hair-long .avatar-hair::after {
  top: 36px;
  width: 24px;
  height: 84px;
}

.avatar-hair-mane .avatar-hair {
  width: 98px;
  height: 88px;
  border-radius: 44px 44px 34px 34px;
}

.avatar-large.avatar-hair-mane .avatar-hair {
  width: 124px;
  height: 112px;
}

.avatar-hair-braids .avatar-hair {
  height: 38px;
}

.avatar-hair-braids .avatar-hair::before,
.avatar-hair-braids .avatar-hair::after {
  content: "";
  position: absolute;
  top: 38px;
  width: 15px;
  height: 56px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,0.18) 0 4px, transparent 5px),
    repeating-linear-gradient(180deg, var(--hair) 0 10px, rgba(0,0,0,0.16) 10px 13px);
}

.avatar-hair-braids .avatar-hair::before {
  left: -5px;
  transform: rotate(8deg);
}

.avatar-hair-braids .avatar-hair::after {
  right: -5px;
  transform: rotate(-8deg);
}

.avatar-large.avatar-hair-braids .avatar-hair::before,
.avatar-large.avatar-hair-braids .avatar-hair::after {
  top: 50px;
  width: 20px;
  height: 76px;
}

.avatar-large .avatar-face {
  width: 96px;
  height: 96px;
  border-radius: 30px 30px 36px 36px;
}

.avatar-face i {
  position: absolute;
  top: 25px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #172033;
}

.avatar-mouth-angry .avatar-face i:first-child {
  transform: rotate(16deg);
  border-radius: 50% 50% 30% 30%;
}

.avatar-mouth-angry .avatar-face i:nth-child(2) {
  transform: rotate(-16deg);
  border-radius: 50% 50% 30% 30%;
}

.avatar-mouth-surprised .avatar-face i {
  top: 23px;
}

.avatar-large.avatar-mouth-surprised .avatar-face i {
  top: 34px;
}

.avatar-large .avatar-face i {
  top: 36px;
  width: 10px;
  height: 10px;
}

.avatar-face i:first-child {
  left: 20px;
}

.avatar-face i:nth-child(2) {
  right: 20px;
}

.avatar-face b {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 22px;
  height: 10px;
  transform: translateX(-50%);
  border-bottom: 3px solid #172033;
  border-radius: 0 0 999px 999px;
}

.avatar-mouth-sad .avatar-face b {
  bottom: 12px;
  border-bottom: 0;
  border-top: 3px solid #172033;
  border-radius: 999px 999px 0 0;
}

.avatar-mouth-angry .avatar-face b {
  width: 24px;
  height: 3px;
  bottom: 18px;
  border: 0;
  border-radius: 999px;
  background: #172033;
  transform: translateX(-50%) rotate(-8deg);
}

.avatar-mouth-surprised .avatar-face b {
  width: 16px;
  height: 18px;
  bottom: 13px;
  border: 3px solid #172033;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.06);
}

.avatar-body {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 82px;
  height: 66px;
  transform: translateX(-50%);
  border-radius: 26px 26px 18px 18px;
  background: linear-gradient(180deg, var(--avatar-main), var(--avatar-dark));
  box-shadow: 0 12px 24px rgba(20, 43, 88, 0.18);
  z-index: 2;
}

.avatar-large .avatar-body {
  width: 112px;
  height: 90px;
  border-radius: 34px 34px 22px 22px;
}

.avatar-outfit-pants .avatar-body {
  background:
    linear-gradient(90deg, transparent 48%, rgba(255,255,255,0.26) 49% 51%, transparent 52%),
    linear-gradient(180deg, var(--avatar-main), var(--avatar-dark));
}

.avatar-outfit-dress .avatar-body {
  width: 92px;
  clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%);
  border-radius: 22px 22px 14px 14px;
  background:
    radial-gradient(circle at 50% 28%, rgba(255,255,255,0.35), transparent 18%),
    linear-gradient(180deg, var(--avatar-main), var(--avatar-dark));
}

.avatar-large.avatar-outfit-dress .avatar-body {
  width: 128px;
}

.avatar-outfit-tunic .avatar-body {
  background:
    linear-gradient(135deg, rgba(246,183,60,0.92) 0 46%, transparent 47%),
    linear-gradient(180deg, var(--avatar-main), var(--avatar-dark));
}

.avatar-legs {
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 48px;
  height: 18px;
  transform: translateX(-50%);
  z-index: 0;
}

.avatar-arm {
  position: absolute;
  top: 80px;
  width: 22px;
  height: 54px;
  border-radius: 999px 999px 14px 14px;
  background:
    radial-gradient(circle at 50% 92%, #fff0d6 0 7px, transparent 8px),
    linear-gradient(180deg, var(--avatar-main) 0 74%, #fff0d6 75% 100%);
  border: 2px solid rgba(11,52,116,0.28);
  z-index: 5;
}

.avatar-arm-left {
  left: 15px;
  transform: rotate(18deg);
  transform-origin: 50% 0;
}

.avatar-arm-right {
  right: 15px;
  transform: rotate(-18deg);
  transform-origin: 50% 0;
}

.avatar-holding-calculator .avatar-arm-left,
.avatar-holding-book .avatar-arm-left {
  left: 22px;
  top: 92px;
  height: 44px;
  transform: rotate(58deg);
}

.avatar-holding-calculator .avatar-arm-right,
.avatar-holding-book .avatar-arm-right {
  right: 17px;
  top: 84px;
  height: 58px;
  transform: rotate(-16deg);
}

.avatar-large.avatar-holding-calculator .avatar-arm-left,
.avatar-large.avatar-holding-book .avatar-arm-left {
  left: 32px;
  top: 126px;
  height: 58px;
}

.avatar-large.avatar-holding-calculator .avatar-arm-right,
.avatar-large.avatar-holding-book .avatar-arm-right {
  right: 24px;
  top: 114px;
  height: 76px;
}

.avatar-holding-backpack .avatar-arm-left,
.avatar-holding-backpack .avatar-arm-right {
  z-index: 5;
}

.avatar-holding-backpack .avatar-arm-left {
  left: 20px;
  top: 88px;
  height: 52px;
  transform: rotate(42deg);
}

.avatar-holding-backpack .avatar-arm-right {
  right: 12px;
  top: 82px;
  height: 60px;
  transform: rotate(-34deg);
}

.avatar-large.avatar-holding-backpack .avatar-arm-left {
  left: 30px;
  top: 120px;
  height: 68px;
}

.avatar-large.avatar-holding-backpack .avatar-arm-right {
  right: 18px;
  top: 112px;
  height: 78px;
}

.avatar-large .avatar-arm {
  top: 104px;
  width: 24px;
  height: 64px;
}

.avatar-large .avatar-arm-left {
  left: 22px;
}

.avatar-large .avatar-arm-right {
  right: 22px;
}

.avatar-legs::before,
.avatar-legs::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 18px;
  height: 22px;
  border-radius: 0 0 9px 9px;
  background: #0b3474;
}

.avatar-legs::before {
  left: 2px;
}

.avatar-legs::after {
  right: 2px;
}

.avatar-outfit-dress .avatar-legs::before,
.avatar-outfit-dress .avatar-legs::after {
  background: #fff7e8;
  height: 14px;
}

.avatar-ear {
  position: absolute;
  top: 6px;
  width: 26px;
  height: 26px;
  background: var(--avatar-main);
  border: 3px solid var(--avatar-dark);
  opacity: 0;
}

.avatar-ear-left {
  left: 16px;
  border-radius: 18px 4px 18px 8px;
  transform: rotate(-24deg);
}

.avatar-ear-right {
  right: 16px;
  border-radius: 4px 18px 8px 18px;
  transform: rotate(24deg);
}

.avatar-cat .avatar-ear,
.avatar-owl .avatar-ear {
  opacity: 1;
}

.avatar-cat .avatar-hair,
.avatar-owl .avatar-hair,
.avatar-robot .avatar-hair {
  opacity: 0.18;
}

.avatar-owl .avatar-face {
  border-radius: 50%;
}

.avatar-robot .avatar-face {
  border-radius: 14px;
  background: #e8f3ff;
}

.avatar-robot .avatar-face::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -16px;
  width: 3px;
  height: 16px;
  transform: translateX(-50%);
  background: var(--avatar-dark);
}

.avatar-accessory {
  position: absolute;
  right: 6px;
  bottom: 28px;
  width: 34px;
  height: 28px;
  border-radius: 8px;
  color: #0b3474;
  background: #fff8df;
  border: 2px solid rgba(242, 176, 52, 0.7);
  box-shadow: 0 8px 14px rgba(20, 43, 88, 0.16);
  z-index: 5;
}

.avatar-large .avatar-accessory {
  right: 8px;
  bottom: 38px;
  width: 44px;
  height: 36px;
  border-radius: 10px;
}

.avatar-holding-calculator .avatar-accessory,
.avatar-holding-book .avatar-accessory {
  left: auto;
  right: 12px;
  bottom: 18px;
  transform: rotate(-6deg);
  z-index: 6;
}

.avatar-large.avatar-holding-calculator .avatar-accessory,
.avatar-large.avatar-holding-book .avatar-accessory {
  right: 16px;
  bottom: 26px;
}

.avatar-accessory::before,
.avatar-accessory::after {
  content: "";
  position: absolute;
}

.avatar-accessory-calculator {
  background:
    linear-gradient(180deg, #f7fbff 0 30%, #2a6fbb 31% 100%);
}

.avatar-accessory-calculator::before {
  left: 7px;
  right: 7px;
  top: 5px;
  height: 7px;
  border-radius: 3px;
  background: #d8f6ee;
  box-shadow: inset 0 0 0 1px rgba(11,52,116,0.2);
}

.avatar-accessory-calculator::after {
  left: 8px;
  top: 16px;
  width: 5px;
  height: 5px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 8px 0 #fff, 16px 0 #fff, 0 8px #fff, 8px 8px #fff, 16px 8px #fff;
}

.avatar-accessory-book {
  background:
    linear-gradient(90deg, #1c64b7 0 47%, #ffffff 48% 52%, #0f9f7a 53% 100%);
  transform: rotate(-8deg);
}

.avatar-accessory-book::before {
  left: 7px;
  top: 6px;
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,0.72);
  box-shadow: 18px 0 rgba(255,255,255,0.72);
}

.avatar-accessory-book::after {
  left: 12px;
  right: 6px;
  bottom: 5px;
  height: 2px;
  background: rgba(255,255,255,0.72);
  box-shadow: 0 -5px rgba(255,255,255,0.55);
}

.avatar-accessory-backpack {
  right: 2px;
  width: 32px;
  height: 36px;
  bottom: 42px;
  border-radius: 12px 12px 9px 9px;
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(255,255,255,0.25) 19% 25%, transparent 26% 74%, rgba(255,255,255,0.25) 75% 81%, transparent 82%),
    linear-gradient(180deg, #f25f4c, #b91d3a);
  z-index: 1;
}

.avatar-large .avatar-accessory-backpack {
  width: 42px;
  height: 48px;
  bottom: 58px;
}

.avatar-accessory-backpack::before {
  left: 7px;
  right: 7px;
  top: -8px;
  height: 14px;
  border: 3px solid #0b3474;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.avatar-accessory-backpack::after {
  left: 6px;
  right: 6px;
  bottom: 7px;
  height: 9px;
  border-radius: 5px;
  background: rgba(255,255,255,0.28);
}

.avatar-editor {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.avatar-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2vw, 28px);
  background: rgba(8, 24, 55, 0.72);
  backdrop-filter: blur(5px);
}

.avatar-editor-modal {
  width: min(1180px, 96vw);
  max-height: 94vh;
  overflow: auto;
  box-shadow: 0 28px 80px rgba(3, 22, 53, 0.38);
}

.avatar-editor-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  gap: 18px;
}

.avatar-preview-card,
.avatar-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid rgba(21, 95, 189, 0.14);
  box-shadow: var(--shadow-tight);
}

.avatar-preview-card {
  justify-items: center;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(11,52,116,0.08), transparent 42%),
    radial-gradient(circle at 18% 20%, rgba(242,176,52,0.28), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(0,159,122,0.18), transparent 25%),
    linear-gradient(180deg, #ffffff, #eef7ff);
  min-height: 390px;
  align-content: center;
}

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

.avatar-preview-card h2,
.avatar-preview-card p {
  margin: 0;
}

.avatar-preview-card p {
  color: var(--muted);
}

.reward-list {
  display: grid;
}

.reward-list strong {
  color: var(--blue-deep);
  font-variant-numeric: tabular-nums;
}

.smart-review {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: #fff8df;
  border: 1px solid rgba(242, 176, 52, 0.38);
}

.map-panel {
  overflow: hidden;
}

.adventure-map-board {
  position: relative;
  min-height: 620px;
  margin-top: 16px;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 13% 17%, rgba(0, 159, 122, 0.28), transparent 20%),
    radial-gradient(circle at 78% 23%, rgba(242, 176, 52, 0.34), transparent 18%),
    radial-gradient(circle at 62% 78%, rgba(21, 95, 189, 0.24), transparent 22%),
    linear-gradient(135deg, #dcecff 0%, #ffffff 44%, #e7fbf4 100%);
  border: 2px solid rgba(11, 52, 116, 0.16);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.72),
    inset 0 -18px 36px rgba(11, 52, 116, 0.06),
    var(--shadow-tight);
}

.adventure-map-board::before,
.adventure-map-board::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
}

.adventure-map-board::before {
  width: 260px;
  height: 116px;
  left: 6%;
  bottom: 8%;
  background:
    radial-gradient(circle at 24% 44%, rgba(255,255,255,0.55) 0 10px, transparent 11px),
    rgba(0, 159, 122, 0.14);
  transform: rotate(-14deg);
}

.adventure-map-board::after {
  width: 190px;
  height: 190px;
  right: 9%;
  top: 11%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.55) 0 18px, transparent 19px),
    rgba(242, 176, 52, 0.18);
}

.map-route-line {
  display: none;
}

.map-route-svg {
  position: absolute;
  inset: 36px 42px;
  width: calc(100% - 84px);
  height: calc(100% - 72px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.96;
}

.map-route-svg polyline {
  fill: none;
  stroke: rgba(246, 183, 60, 0.88);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 10;
  vector-effect: non-scaling-stroke;
  filter:
    drop-shadow(0 4px 0 rgba(11, 52, 116, 0.18))
    drop-shadow(0 10px 10px rgba(11, 52, 116, 0.12));
}

.map-node {
  position: absolute;
  width: clamp(142px, 16.5vw, 188px);
  min-height: 158px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  padding: 12px;
  border: 2px solid rgba(21, 95, 189, 0.18);
  border-radius: 16px;
  color: #13223b;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(238,247,255,0.94));
  box-shadow:
    0 8px 0 rgba(21, 95, 189, 0.15),
    0 18px 30px rgba(20, 43, 88, 0.14);
  text-align: center;
  z-index: 2;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.map-node::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.78);
  pointer-events: none;
}

.map-node:hover:not(:disabled),
.map-node:focus-visible:not(:disabled) {
  transform: translateY(-4px);
  box-shadow:
    0 12px 0 rgba(21, 95, 189, 0.15),
    0 24px 36px rgba(20, 43, 88, 0.18);
}

.map-node strong {
  font-size: 0.94rem;
  line-height: 1.15;
}

.map-node small {
  color: #59667a;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
}

.map-node em {
  padding: 3px 8px;
  border-radius: 999px;
  color: #0b3474;
  background: #fff8df;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 950;
}

.current-avatar-marker {
  position: absolute;
  right: -10px;
  top: -28px;
  display: grid;
  place-items: center;
  width: 58px;
  height: 68px;
  border-radius: 18px;
  background: #ffffff;
  border: 2px solid rgba(246, 183, 60, 0.9);
  box-shadow: 0 8px 0 rgba(246, 183, 60, 0.2), 0 16px 24px rgba(20, 43, 88, 0.18);
  z-index: 4;
}

.current-avatar-marker::after {
  content: "Aqui";
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 999px;
  color: #0b3474;
  background: #fff8df;
  border: 1px solid rgba(246, 183, 60, 0.6);
  font-size: 0.62rem;
  font-weight: 950;
}

.current-avatar-marker .avatar-figure {
  transform: scale(0.42);
  transform-origin: center bottom;
}

.zone-visual {
  position: relative;
  display: block;
  width: 96px;
  height: 66px;
  margin-bottom: 2px;
}

.zone-visual svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.zone-visual text {
  fill: #0b3474;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 9px;
  font-weight: 950;
  text-anchor: middle;
  dominant-baseline: middle;
}

.zone-ground,
.zone-axis,
.zone-arrow,
.zone-balance,
.zone-bridge,
.zone-bridge-arch,
.zone-bridge-deck,
.zone-bridge-pillar,
.zone-bridge-rail,
.zone-bridge-posts,
.zone-path,
.zone-scope,
.zone-water,
.zone-plaza-tile {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zone-ground {
  stroke: rgba(11, 52, 116, 0.28);
  stroke-width: 3;
}

.zone-roof,
.zone-tower-roof,
.zone-temple-roof,
.zone-chest-lid {
  fill: #f2b034;
  stroke: rgba(11, 52, 116, 0.34);
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.zone-house,
.zone-tower,
.zone-base,
.zone-book,
.zone-number-board,
.zone-shape,
.zone-chest {
  fill: #ffffff;
  stroke: rgba(11, 52, 116, 0.42);
  stroke-width: 2.2;
}

.zone-house.is-main,
.zone-book.is-main,
.zone-shape.is-main,
.zone-crystal.is-main {
  fill: #dcecff;
}

.zone-path {
  stroke: #f2b034;
  stroke-width: 9;
  stroke-dasharray: 1 7;
}

.zone-dot,
.zone-star,
.zone-lock {
  fill: #f2b034;
  stroke: rgba(11, 52, 116, 0.32);
  stroke-width: 2;
}

.zone-block {
  fill: #ffffff;
  stroke: rgba(11, 52, 116, 0.46);
  stroke-width: 2;
}

.zone-block.is-top {
  fill: #dcecff;
}

.zone-bridge-arch,
.zone-bridge-deck,
.zone-bridge-pillar,
.zone-bridge-rail,
.zone-bridge-posts,
.zone-column,
.zone-axis {
  stroke: #ffffff;
  stroke-width: 5;
}

.zone-bridge-arch {
  stroke-width: 5.5;
}

.zone-bridge-deck {
  stroke: #0b3474;
  stroke-width: 5;
}

.zone-bridge-rail,
.zone-bridge-posts {
  stroke: rgba(11, 52, 116, 0.58);
  stroke-width: 2.4;
}

.zone-water {
  stroke: #4db7d9;
  stroke-width: 3;
}

.zone-column {
  fill: none;
  stroke-linecap: round;
}

.zone-tower,
.zone-dome,
.zone-base {
  fill: #ffffff;
  stroke: rgba(11, 52, 116, 0.44);
  stroke-width: 2.4;
}

.zone-hill {
  fill: #009f7a;
  opacity: 0.86;
}

.zone-hill.is-back {
  fill: #8ed8be;
  opacity: 0.9;
}

.zone-arrow,
.zone-scope,
.zone-balance {
  stroke: #0b3474;
  stroke-width: 3;
}

.zone-tree {
  fill: #009f7a;
  stroke: rgba(11, 52, 116, 0.24);
  stroke-width: 1.8;
}

.zone-tree.is-main {
  fill: #087a5c;
}

.zone-trunk {
  stroke: #9f6b0f;
  stroke-width: 3;
  stroke-linecap: round;
}

.zone-dome {
  fill: #dcecff;
}

.zone-crystal {
  fill: #8ed8ff;
  stroke: rgba(11, 52, 116, 0.38);
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.zone-book.is-alt,
.zone-shape.is-alt {
  fill: #f2b034;
}

.zone-plaza-floor {
  fill: #ffffff;
  stroke: rgba(11, 52, 116, 0.36);
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.zone-plaza-tile {
  stroke: rgba(21, 95, 189, 0.22);
  stroke-width: 1.8;
}

.zone-plaza-center {
  fill: #dcecff;
  stroke: #155fbd;
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.zone-plaza-poly {
  fill: #f2b034;
  stroke: rgba(11, 52, 116, 0.36);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.zone-plaza-poly.is-right {
  fill: #8ed8be;
}

.zone-curve {
  fill: none;
  stroke: #f2b034;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zone-chest {
  fill: #f2b034;
}

.zone-visual i,
.zone-visual b,
.zone-visual em {
  position: absolute;
  display: block;
}

.zone-visual-village i {
  bottom: 4px;
  width: 22px;
  height: 20px;
  border-radius: 4px 4px 2px 2px;
  background: #ffffff;
  border: 2px solid rgba(11, 52, 116, 0.5);
}

.zone-visual-village i::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -12px;
  width: 26px;
  height: 18px;
  transform: rotate(45deg);
  border-radius: 3px;
  background: #f2b034;
  border: 2px solid rgba(11, 52, 116, 0.28);
}

.zone-visual-village i:nth-child(1) { left: 4px; }
.zone-visual-village i:nth-child(2) { left: 27px; transform: scale(1.12); }
.zone-visual-village i:nth-child(3) { right: 4px; }

.zone-visual-road b {
  left: 4px;
  right: 4px;
  bottom: 11px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f2b034, #ffffff);
  border: 2px dashed rgba(11, 52, 116, 0.45);
  transform: rotate(-12deg);
}

.zone-visual-road i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #155fbd;
}

.zone-visual-road i:nth-child(1) { left: 12px; top: 11px; }
.zone-visual-road i:nth-child(2) { left: 34px; top: 24px; }
.zone-visual-road i:nth-child(3) { right: 12px; top: 12px; }

.zone-visual-wall i {
  bottom: 6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #ffffff;
  background: #0b3474;
  border: 2px solid rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 950;
}

.zone-visual-wall i:nth-child(1) { left: 4px; }
.zone-visual-wall i:nth-child(1)::before { content: "-3"; }
.zone-visual-wall i:nth-child(2) { left: 27px; bottom: 18px; }
.zone-visual-wall i:nth-child(2)::before { content: "+"; }
.zone-visual-wall i:nth-child(3) { right: 4px; }
.zone-visual-wall i:nth-child(3)::before { content: "7"; }

.zone-visual-bridge b {
  left: 8px;
  right: 8px;
  bottom: 12px;
  height: 22px;
  border: 5px solid #ffffff;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
}

.zone-visual-bridge i {
  bottom: 4px;
  width: 12px;
  height: 18px;
  background: #f2b034;
  border-radius: 3px;
}

.zone-visual-bridge i:nth-child(1) { left: 16px; }
.zone-visual-bridge i:nth-child(2) { left: 32px; }
.zone-visual-bridge i:nth-child(3) { right: 16px; }

.zone-visual-tower b {
  left: 24px;
  bottom: 4px;
  width: 28px;
  height: 40px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #ffffff, #dcecff);
  border: 2px solid rgba(11, 52, 116, 0.45);
}

.zone-visual-tower b::before {
  content: "x²";
  position: absolute;
  left: 50%;
  top: 9px;
  transform: translateX(-50%);
  color: #0b3474;
  font-weight: 950;
}

.zone-visual-tower i {
  top: 0;
  left: 19px;
  width: 38px;
  height: 16px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #f2b034;
}

.zone-visual-valley b {
  left: 2px;
  right: 2px;
  bottom: 6px;
  height: 24px;
  border-radius: 50% 50% 10px 10px;
  background: linear-gradient(135deg, #009f7a, #8ed8be);
}

.zone-visual-valley i {
  bottom: 16px;
  width: 22px;
  height: 18px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #0b3474;
  opacity: 0.75;
}

.zone-visual-valley i:nth-child(1) { left: 6px; }
.zone-visual-valley i:nth-child(2) { left: 27px; transform: scale(1.35); }
.zone-visual-valley i:nth-child(3) { right: 6px; }

.zone-visual-forest i {
  bottom: 6px;
  width: 26px;
  height: 38px;
  clip-path: polygon(50% 0, 100% 72%, 70% 72%, 100% 100%, 0 100%, 30% 72%, 0 72%);
  background: linear-gradient(180deg, #009f7a, #087a5c);
}

.zone-visual-forest i:nth-child(1) { left: 4px; transform: scale(0.82); }
.zone-visual-forest i:nth-child(2) { left: 25px; }
.zone-visual-forest i:nth-child(3) { right: 4px; transform: scale(0.9); }

.zone-visual-temple b {
  left: 8px;
  right: 8px;
  bottom: 5px;
  height: 8px;
  background: #ffffff;
  border-radius: 3px;
}

.zone-visual-temple b::before {
  content: "";
  position: absolute;
  left: 0;
  top: -35px;
  width: 60px;
  height: 16px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #f2b034;
}

.zone-visual-temple i {
  bottom: 12px;
  width: 10px;
  height: 28px;
  background: #ffffff;
  border-radius: 999px;
}

.zone-visual-temple i:nth-child(1) { left: 16px; }
.zone-visual-temple i:nth-child(2) { left: 33px; }
.zone-visual-temple i:nth-child(3) { right: 16px; }

.zone-visual-observatory b {
  left: 19px;
  bottom: 7px;
  width: 38px;
  height: 28px;
  border-radius: 38px 38px 4px 4px;
  background: #ffffff;
  border: 2px solid rgba(11, 52, 116, 0.42);
}

.zone-visual-observatory i:nth-child(1) {
  left: 31px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f2b034;
}

.zone-visual-observatory i:nth-child(2) {
  left: 48px;
  top: 10px;
  width: 22px;
  height: 7px;
  border-radius: 999px;
  background: #0b3474;
  transform: rotate(-24deg);
}

.zone-visual-crystals i {
  bottom: 5px;
  width: 20px;
  height: 36px;
  clip-path: polygon(50% 0, 100% 24%, 78% 100%, 22% 100%, 0 24%);
  background: linear-gradient(180deg, #dcecff, #155fbd);
}

.zone-visual-crystals i:nth-child(1) { left: 10px; transform: scale(0.82); }
.zone-visual-crystals i:nth-child(2) { left: 29px; }
.zone-visual-crystals i:nth-child(3) { right: 10px; transform: scale(0.9); }

.zone-visual-library i {
  bottom: 5px;
  width: 15px;
  height: 36px;
  border-radius: 3px;
  background: #ffffff;
  border: 2px solid rgba(11, 52, 116, 0.38);
}

.zone-visual-library i:nth-child(1) { left: 15px; }
.zone-visual-library i:nth-child(2) { left: 31px; height: 42px; background: #f2b034; }
.zone-visual-library i:nth-child(3) { right: 15px; }

.zone-visual-workshop b {
  left: 12px;
  bottom: 8px;
  width: 52px;
  height: 28px;
  border-radius: 8px;
  background: #ffffff;
  border: 2px solid rgba(11, 52, 116, 0.44);
}

.zone-visual-workshop b::before {
  content: "=";
  position: absolute;
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
  color: #155fbd;
  font-size: 1.35rem;
  font-weight: 950;
}

.zone-visual-geometry i:nth-child(1) {
  left: 5px;
  bottom: 7px;
  width: 28px;
  height: 28px;
  background: #ffffff;
  border: 3px solid #155fbd;
  transform: rotate(45deg);
}

.zone-visual-geometry i:nth-child(2) {
  left: 29px;
  top: 4px;
  width: 34px;
  height: 30px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #f2b034;
}

.zone-visual-geometry i:nth-child(3) {
  right: 4px;
  bottom: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #009f7a;
}

.zone-visual-graph b {
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 34px;
  border-left: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
}

.zone-visual-graph b::before {
  content: "";
  position: absolute;
  left: 6px;
  bottom: 5px;
  width: 46px;
  height: 24px;
  border-top: 4px solid #f2b034;
  border-radius: 50% 50% 0 0;
  transform: rotate(-8deg);
}

.zone-visual-chest b {
  left: 13px;
  bottom: 7px;
  width: 50px;
  height: 30px;
  border-radius: 8px 8px 5px 5px;
  background: #f2b034;
  border: 3px solid rgba(11, 52, 116, 0.52);
}

.zone-visual-chest b::before {
  content: "?";
  position: absolute;
  left: 50%;
  top: 1px;
  transform: translateX(-50%);
  color: #0b3474;
  font-weight: 950;
}

.zone-visual-numbers b {
  left: 8px;
  right: 8px;
  top: 6px;
  bottom: 6px;
  border-radius: 14px;
  background: rgba(255,255,255,0.85);
  border: 2px solid rgba(11, 52, 116, 0.32);
}

.zone-visual-numbers b::before {
  content: "1 2 3";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #0b3474;
  font-weight: 950;
}

.map-node.is-active {
  border-color: rgba(242, 176, 52, 0.82);
  background:
    radial-gradient(circle at 50% 10%, rgba(246,183,60,0.26), transparent 28%),
    linear-gradient(180deg, #ffffff, #fff8df);
  box-shadow: 0 0 0 4px rgba(242, 176, 52, 0.18), 0 10px 0 rgba(242, 176, 52, 0.24), 0 22px 34px rgba(20, 43, 88, 0.18);
}

.map-node.is-current {
  animation: currentPulse 1.8s ease-in-out infinite;
}

.map-node.is-locked {
  cursor: not-allowed;
  opacity: 0.78;
  filter: grayscale(0.12);
}

.map-node.is-complete {
  background:
    radial-gradient(circle at 82% 12%, rgba(0,159,122,0.22), transparent 20%),
    linear-gradient(180deg, #ffffff, #e7fbf4);
  border-color: rgba(0, 159, 122, 0.34);
}

.map-node.zone-1 { left: 6%; top: 8%; }
.map-node.zone-2 { left: 31%; top: 18%; }
.map-node.zone-3 { left: 58%; top: 8%; }
.map-node.zone-4 { left: 73%; top: 32%; }
.map-node.zone-5 { left: 49%; top: 42%; }
.map-node.zone-6 { left: 20%; top: 38%; }
.map-node.zone-7 { left: 8%; top: 64%; }
.map-node.zone-8 { left: 35%; top: 70%; }
.map-node.zone-9 { left: 62%; top: 62%; }
.map-node.zone-10 { left: 76%; top: 76%; }

/* Adventure atlas: one clear landmark per topic, with a distinct course landscape. */
.adventure-map-board {
  min-height: var(--map-height, 650px);
  isolation: isolate;
  background: #eaf5ff;
  border: 0;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(20, 87, 184, 0.12), 0 8px 24px rgba(20, 43, 88, 0.1);
}

.map-course-1eso {
  background: linear-gradient(180deg, #dff3ff 0 48%, #d8f0d5 49% 100%);
}

.map-course-2eso {
  background: linear-gradient(180deg, #e6f3ff 0 46%, #dbe7f4 47% 100%);
}

.map-course-3eso {
  background: linear-gradient(180deg, #e8efff 0 47%, #d9eadc 48% 100%);
}

.map-course-4eso-a {
  background: linear-gradient(180deg, #e9f7ff 0 49%, #d9efe8 50% 100%);
}

.map-course-4eso-b {
  background: linear-gradient(180deg, #e8edfb 0 45%, #d8e2ef 46% 100%);
}

.adventure-map-board::before,
.adventure-map-board::after {
  display: none;
}

.map-world-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.map-land-horizon,
.map-coast {
  fill: rgba(44, 143, 105, 0.15);
}

.map-course-2eso .map-land-horizon { fill: rgba(71, 111, 157, 0.12); }
.map-course-3eso .map-land-horizon { fill: rgba(39, 116, 79, 0.13); }
.map-course-4eso-a .map-land-horizon { fill: rgba(29, 143, 126, 0.13); }
.map-course-4eso-b .map-land-horizon { fill: rgba(67, 86, 128, 0.13); }

.map-river,
.map-canal,
.map-coast {
  fill: none;
  stroke: rgba(50, 151, 201, 0.34);
  stroke-width: 5;
  stroke-linecap: round;
}

.map-mountain,
.map-hill-line,
.map-city,
.map-bridge-mark,
.map-geometry-mark,
.map-ridge,
.map-academy,
.map-tree-line {
  fill: none;
  stroke: rgba(28, 73, 128, 0.18);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-sun,
.map-moon {
  fill: rgba(246, 183, 60, 0.32);
}

.map-stars {
  fill: none;
  stroke: rgba(70, 75, 145, 0.3);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.map-route-svg {
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.map-route-svg polyline {
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 5;
  stroke-dasharray: 1 8;
  filter: drop-shadow(0 2px 0 rgba(20, 87, 184, 0.16));
}

.map-node,
.map-node.zone-1,
.map-node.zone-2,
.map-node.zone-3,
.map-node.zone-4,
.map-node.zone-5,
.map-node.zone-6,
.map-node.zone-7,
.map-node.zone-8,
.map-node.zone-9,
.map-node.zone-10 {
  left: var(--node-x);
  top: var(--node-y);
  width: 154px;
  min-height: 136px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  color: #13223b;
  background: transparent;
  border: 0;
  border-radius: 10px;
  box-shadow: none;
  transform: translate(-50%, -50%);
  overflow: visible;
}

.map-node::before {
  inset: 34px 18px auto;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 7px 0 rgba(28, 85, 120, 0.08);
  transform: perspective(100px) rotateX(48deg);
}

.map-node:hover:not(:disabled),
.map-node:focus-visible:not(:disabled) {
  transform: translate(-50%, calc(-50% - 5px));
  box-shadow: none;
}

.map-node:focus-visible {
  outline: 3px solid #1457b8;
  outline-offset: 6px;
}

.map-node .zone-visual {
  width: 112px;
  height: 78px;
  margin: 0;
  z-index: 2;
  filter: drop-shadow(0 7px 5px rgba(20, 43, 88, 0.12));
}

.map-node-label {
  position: relative;
  z-index: 3;
  width: 100%;
  min-height: 47px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 6px 9px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 8px rgba(20, 43, 88, 0.12);
}

.map-node-label strong,
.map-node-label small {
  display: block;
  overflow-wrap: anywhere;
}

.map-node-label strong {
  font-size: 0.78rem;
  line-height: 1.1;
}

.map-node-label small {
  color: #4d5f77;
  font-size: 0.66rem;
  font-weight: 750;
  line-height: 1.12;
}

.zone-orb {
  position: absolute;
  left: 10px;
  top: 3px;
  z-index: 4;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #1457b8;
  box-shadow: 0 3px 0 #0b3474;
  font-size: 0.72rem;
  font-weight: 950;
}

.map-node.is-active,
.map-node.is-complete {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.map-node.is-active .map-node-label {
  color: #0b3474;
  background: #fff8df;
  box-shadow: 0 0 0 3px rgba(246, 183, 60, 0.48), 0 7px 10px rgba(20, 43, 88, 0.14);
}

.map-node.is-complete .zone-orb {
  background: #008c68;
  box-shadow: 0 3px 0 #086449;
}

.map-node.is-complete .map-node-label::after {
  content: "✓";
  position: absolute;
  right: 7px;
  top: -10px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #008c68;
  font-size: 0.74rem;
  font-weight: 950;
}

.map-node.is-locked {
  opacity: 0.48;
  filter: grayscale(0.72);
}

.map-node.is-current {
  animation: none;
}

.map-node.is-current .zone-visual {
  animation: currentLandmark 2.2s ease-in-out infinite;
}

.map-node .current-avatar-marker {
  right: -13px;
  top: 34px;
  width: 54px;
  height: 70px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.map-node .current-avatar-marker::after {
  bottom: -8px;
  color: #0b3474;
  background: #fff8df;
  border: 1px solid rgba(246, 183, 60, 0.6);
}

.map-node .current-avatar-marker .avatar-figure {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) scale(0.34);
  transform-origin: center bottom;
}

@keyframes currentLandmark {
  50% { transform: translateY(-4px); }
}

@keyframes currentPulse {
  50% {
    transform: translateY(-4px);
  }
}

.zone-detail {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 18px;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid rgba(21, 95, 189, 0.14);
  box-shadow: var(--shadow-tight);
}

.zone-detail span {
  color: var(--blue);
  font-weight: 950;
}

.zone-detail h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  line-height: 1.05;
}

.zone-detail p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.zone-detail-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.adventure-zone-entry {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.zone-entry-head {
  margin-bottom: 16px;
}

.zone-entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: stretch;
}

.zone-entry-scene {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 16px;
  background: linear-gradient(180deg, #dff3ff 0 52%, #d8f0d5 53% 100%);
  box-shadow: inset 0 0 0 2px rgba(20, 87, 184, 0.12);
}

.zone-entry-scene .map-world-backdrop {
  opacity: 0.82;
}

.zone-entry-scene::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(8, 47, 104, 0.14));
}

.zone-scene-landmark {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 2;
  transform: translate(-50%, -50%);
}

.zone-scene-landmark .zone-visual {
  width: clamp(250px, 31vw, 360px);
  height: clamp(180px, 23vw, 250px);
  margin: 0;
  filter: drop-shadow(0 12px 8px rgba(20, 43, 88, 0.2));
}

.zone-scene-landmark .zone-visual text {
  font-size: 8px;
}

.zone-scene-avatar {
  position: absolute;
  right: 22px;
  bottom: 82px;
  z-index: 4;
  transform: scale(0.72);
  transform-origin: right bottom;
}

.zone-scene-avatar .avatar-scene {
  display: none;
}

.zone-scene-copy {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 5;
  max-width: 68ch;
  padding: 13px 16px;
  border-radius: 12px;
  color: #10213c;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 0 rgba(8, 47, 104, 0.12);
}

.zone-scene-copy span {
  color: #1457b8;
  font-size: 0.76rem;
  font-weight: 900;
}

.zone-scene-copy h2 {
  margin: 2px 0 4px;
  font-size: 1.45rem;
  line-height: 1.1;
}

.zone-scene-copy p {
  margin: 0;
  color: #455873;
  line-height: 1.35;
}

.zone-mission-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0;
}

.zone-mission-panel h2 {
  margin: 0 0 4px;
  font-size: 1.45rem;
}

.zone-mission-panel p {
  margin: 0;
  color: #52627a;
  line-height: 1.4;
}

.zone-mode-grid {
  display: grid;
  gap: 9px;
}

.zone-mode-button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 64px;
  padding: 10px 13px;
  text-align: left;
  color: #13223b;
  background: #f7fbff;
  border: 2px solid rgba(20, 87, 184, 0.18);
  border-radius: 10px;
  box-shadow: 0 4px 0 rgba(20, 87, 184, 0.12);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.zone-mode-button:hover,
.zone-mode-button:focus-visible {
  transform: translateY(-2px);
  border-color: #1457b8;
  background: #edf6ff;
}

.zone-mode-button:focus-visible {
  outline: 3px solid rgba(20, 87, 184, 0.28);
  outline-offset: 2px;
}

.zone-mode-button span {
  color: #0b3474;
  font-size: 1rem;
  font-weight: 950;
}

.zone-mode-button small {
  color: #4d5f77;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
}

.zone-mode-button.mode-boss {
  border-color: rgba(218, 151, 22, 0.42);
  background: #fff8df;
}

.zone-status-complete {
  color: #086449;
  background: #e7fbf4;
}

.zone-study-link {
  width: 100%;
  margin-top: auto;
}

.map-path {
  display: grid;
  gap: 14px;
}

.map-zone {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid rgba(21, 95, 189, 0.14);
  box-shadow: var(--shadow-tight);
}

.map-zone.is-locked {
  opacity: 0.62;
  filter: grayscale(0.3);
}

.map-zone.is-complete {
  border-color: rgba(0, 159, 122, 0.34);
  background: linear-gradient(135deg, #ffffff, #e7fbf4);
}

.zone-orb {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  font-weight: 950;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.map-zone span {
  color: var(--blue);
  font-weight: 900;
}

.map-zone h3 {
  margin: 3px 0 6px;
  font-size: 1.2rem;
}

.phase-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.phase-row button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.zone-complete {
  display: inline-block;
  margin-top: 10px;
  color: var(--green);
}

.adventure-phase,
.adventure-question,
.result-panel {
  width: min(980px, 100%);
  margin: 0 auto;
}

.phase-card {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 26px);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  border: 1px solid rgba(21, 95, 189, 0.14);
}

.phase-card h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.training-lanes,
.teacher-prep {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.training-lanes article,
.teacher-prep article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid rgba(21, 95, 189, 0.14);
}

.training-lane {
  display: grid;
  min-height: 142px;
  align-content: start;
  gap: 8px;
  padding: 16px;
  text-align: left;
  color: #13223b;
  background: #ffffff;
  border: 2px solid rgba(21, 95, 189, 0.18);
  border-radius: var(--radius-sm);
  box-shadow: 0 5px 0 rgba(21, 95, 189, 0.12);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.training-lane:hover,
.training-lane:focus-visible {
  transform: translateY(-3px);
  border-color: #1457b8;
  background: #f2f8ff;
}

.training-lane:focus-visible {
  outline: 3px solid rgba(20, 87, 184, 0.28);
  outline-offset: 2px;
}

.training-lane strong {
  color: #0b3474;
  font-size: 1.18rem;
}

.training-lane span {
  color: #52627a;
  font-weight: 700;
  line-height: 1.35;
}

.training-lane em {
  align-self: end;
  color: #087b61;
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 950;
}

.training-lane.difficulty-hard {
  border-color: rgba(218, 151, 22, 0.42);
  background: #fffaf0;
}

.training-lanes span,
.teacher-prep span {
  color: var(--muted);
  line-height: 1.4;
}

.minigame-card {
  background:
    radial-gradient(circle at 90% 10%, rgba(242,176,52,0.2), transparent 28%),
    linear-gradient(180deg, #ffffff, #f1fff8);
}

.minigame-stage {
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: var(--radius);
  color: #0b3474;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.35;
  background: #ffffff;
  border: 1px solid rgba(0, 159, 122, 0.22);
}

.boss-card {
  color: white;
  background:
    radial-gradient(circle at 12% 15%, rgba(242,176,52,0.32), transparent 28%),
    linear-gradient(135deg, #172033, #0b3474 48%, #7a2940);
}

.boss-card p {
  color: rgba(255, 255, 255, 0.84);
}

.duel-bars {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.duel-bars > div > span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-weight: 900;
}

.boss-progress span {
  background: linear-gradient(90deg, #e92b4f, #f47b38);
}

.energy-progress span {
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.result-panel {
  text-align: center;
}

.topic-card h3 {
  font-size: 1.08rem;
  line-height: 1.25;
  text-wrap: balance;
}

.study-layout {
  grid-template-columns: minmax(340px, 0.95fr) minmax(360px, 1.05fr);
  gap: clamp(16px, 2vw, 22px);
  align-items: start;
}

.app-grid > aside.screen-panel {
  position: sticky;
  top: 18px;
  background:
    linear-gradient(180deg, rgba(21, 95, 189, 0.08), rgba(255, 255, 255, 0.96) 42%),
    #ffffff;
}

.sidebar-title {
  font-size: 1.35rem;
  line-height: 1.18;
  text-wrap: balance;
}

.progress {
  height: 14px;
  background: #dfeafa;
  box-shadow: inset 0 1px 2px rgba(20, 43, 88, 0.08);
}

.progress span {
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green), var(--blue));
}

.explain-panel,
.game-panel {
  overflow: hidden;
}

.explain-panel h2,
.game-panel h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: #111827;
  font-size: 1.28rem;
}

.explain-panel h2::before,
.game-panel h2::before {
  content: "";
  width: 12px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--blue), var(--green));
}

.game-panel h2::before {
  background: linear-gradient(180deg, var(--red), var(--gold));
}

.topic-summary-card {
  border-radius: var(--radius);
  padding: clamp(18px, 2.5vw, 26px);
  background:
    linear-gradient(135deg, rgba(21, 95, 189, 0.12), rgba(0, 159, 122, 0.1)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.52));
  border: 1px solid rgba(21, 95, 189, 0.16);
}

.topic-kicker {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--blue-deep);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(21, 95, 189, 0.12);
  font-size: 0.78rem;
}

.topic-summary-card h3 {
  max-width: 11ch;
  color: #101828;
  font-size: clamp(2rem, 4vw, 4.6rem);
  line-height: 0.98;
  text-wrap: balance;
}

.topic-actions {
  gap: 10px;
}

.topic-explanation-detail {
  gap: 16px;
}

.lesson-slides {
  display: grid;
  gap: 10px;
}

.lesson-slide {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid rgba(21, 95, 189, 0.12);
  box-shadow: 0 8px 16px rgba(20, 43, 88, 0.06);
}

.lesson-slide span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--green));
  font-weight: 950;
}

.lesson-slide strong {
  color: #111827;
}

.worked-example,
.solution-help {
  border-radius: var(--radius-sm);
}

.solution-help-body {
  margin-top: 12px;
  color: #243653;
  font-size: clamp(1.16rem, 1.3vw, 1.32rem);
  font-weight: 600;
  line-height: 1.72;
}

.bach-exam-screen .solution-help-body,
.block-challenge-screen .solution-help-body {
  font-size: clamp(1.2rem, 1.38vw, 1.4rem);
}

.solution-section-title {
  display: inline-block;
  margin-top: 7px;
  color: #0b3474;
  font-size: 1.02rem;
  font-weight: 950;
}

.solution-help-body .math-matrix,
.solution-help-body .math-root {
  color: #111827;
}

.book-explanation {
  max-height: 430px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-tight);
}

.question-box {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.question-text {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: var(--radius);
  color: #111827;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(237, 245, 255, 0.96));
  border: 1px solid rgba(21, 95, 189, 0.14);
  box-shadow: var(--shadow-tight);
  font-size: clamp(1.18rem, 2vw, 1.55rem);
}

.exercise-with-source-figure {
  display: grid;
  gap: 12px;
}

.exercise-with-source-figure p {
  margin: 0;
}

.exercise-with-source-figure img {
  display: block;
  width: auto;
  max-width: min(100%, 720px);
  max-height: 330px;
  margin: 0 auto;
  object-fit: contain;
}

.pau-open-statement {
  white-space: pre-line;
  text-align: left;
  font-size: 1.05rem;
  line-height: 1.62;
  font-weight: 760;
}

.pau-open-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.math-root {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  font-weight: 900;
  white-space: nowrap;
}

.math-root::before {
  content: "√";
  font-size: 1.05em;
  line-height: 1;
}

.math-root .radicand {
  display: inline-block;
  padding: 0 2px;
  border-top: 2px solid currentColor;
  line-height: 1.05;
}

.math-matrix {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 4px;
  vertical-align: middle;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.math-space {
  display: inline-block;
  width: 1em;
}

.math-space-wide {
  width: 2em;
}

.math-aligned {
  display: inline;
}

.math-aligned-break {
  display: inline-block;
  width: 0.75em;
}

.matrix-bracket {
  display: inline-flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  width: 0.5em;
  min-height: 0;
  overflow: visible;
  box-sizing: border-box;
  font-family: "Cambria Math", "STIX Two Math", Georgia, serif;
  font-size: 2.25em;
  font-weight: 400;
  line-height: 0.72;
  transform: scaleY(1.18);
  transform-origin: center;
  color: inherit;
}

.math-matrix:not(.math-determinant):has(.matrix-row:nth-child(3)) > .matrix-bracket {
  font-size: 3.25em;
}

.math-matrix:not(.math-determinant):has(.matrix-row:nth-child(4)) > .matrix-bracket {
  font-size: 4.25em;
}

.math-matrix:not(.math-determinant) > .matrix-bracket:first-child,
.math-matrix:not(.math-determinant) > .matrix-bracket:last-child {
  border: 0;
  border-radius: 0;
}

.matrix-grid {
  display: inline-grid;
  grid-template-columns: repeat(var(--matrix-columns, 1), minmax(20px, max-content));
  gap: 2px 12px;
  padding: 2px 1px;
}

.matrix-row {
  display: contents;
}

.matrix-row span {
  text-align: center;
}

.question-text sup,
.answer-btn sup,
.solution-help sup {
  font-size: 0.72em;
  line-height: 0;
}

.answers {
  gap: 12px;
}

.answer-btn {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  border: 1px solid rgba(21, 95, 189, 0.16);
  box-shadow: 0 5px 0 #c9d9ee, 0 14px 24px rgba(20, 43, 88, 0.12);
  font-size: 1.08rem;
  line-height: 1.45;
  text-align: left;
}

.answer-btn::before {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-weight: 950;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.answer-btn:nth-child(1)::before {
  content: "A";
}

.answer-btn:nth-child(2)::before {
  content: "B";
}

.answer-btn:nth-child(3)::before {
  content: "C";
}

.answer-btn:nth-child(4)::before {
  content: "D";
}

.answer-btn:hover {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.answer-btn.correct {
  background: linear-gradient(135deg, #078865, var(--green));
}

.answer-btn.wrong {
  background: linear-gradient(135deg, #c8203e, var(--red));
}

.feedback {
  color: #111827;
}

.timer-stat {
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
}

.timer-warning {
  background: linear-gradient(135deg, #c8203e, #f47b38);
}

@media (max-width: 980px) {
  .app-grid,
  .study-layout {
    grid-template-columns: 1fr;
  }

  .app-grid > aside.screen-panel {
    position: static;
  }

  .topic-summary-card h3 {
    max-width: none;
    font-size: clamp(2rem, 10vw, 3.6rem);
  }
}

@media (max-width: 760px), (max-height: 620px) {
  .bach-ii-home-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    min-height: 0;
  }

  .bach-home-topics,
  .bach-home-blocks,
  .bach-home-exam {
    grid-column: auto;
    grid-row: auto;
    min-height: 240px;
  }

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

  .exam-actions > button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body::before {
    display: none;
  }

  .top-strip {
    padding-top: 76px;
  }

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

  .answer-btn {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 58px;
    font-size: 1rem;
  }

  .answer-btn::before {
    width: 30px;
    height: 30px;
  }

  .lesson-slide {
    grid-template-columns: 1fr;
  }

  .lesson-slide span {
    grid-row: auto;
  }
}

/* ESO gateway: three learning routes fitted to a desktop viewport without
   introducing nested scroll containers. */
.coach-gateway .home-panel {
  min-width: 0;
  min-height: 0;
  padding: clamp(16px, 2vw, 24px);
  overflow: visible;
}

.coach-gateway .workspace-head {
  margin-bottom: clamp(10px, 1.4vh, 16px);
  padding-bottom: clamp(8px, 1.1vh, 12px);
}

.coach-gateway .workspace-head h1 {
  font-size: clamp(1.75rem, 2.8vw, 2.65rem);
}

.eso-home-grid {
  min-width: 0;
  min-height: min(540px, calc(100dvh - 270px));
  gap: clamp(10px, 1.3vw, 16px);
}

.eso-home-grid .path-choice {
  min-width: 0;
  min-height: 0;
  gap: clamp(7px, 1vh, 12px);
  padding: clamp(14px, 1.7vw, 22px);
}

.eso-home-grid .path-choice h2,
.eso-home-grid .eso-home-coach h2,
.eso-home-grid .eso-home-exam h2 {
  font-size: clamp(1.45rem, 2.25vw, 2.2rem);
  line-height: 1.06;
}

.eso-home-grid .path-choice p {
  font-size: clamp(0.9rem, 1.05vw, 1.04rem);
  line-height: 1.35;
}

.eso-home-grid .path-icon {
  padding: 7px 11px;
  font-size: 0.9rem;
}

.eso-home-grid .path-choice .primary,
.eso-home-grid .path-choice .secondary {
  min-height: 40px;
  padding: 8px 16px;
}

@media (max-width: 980px) {
  .eso-home-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    min-height: 0;
  }

  .eso-home-grid .eso-home-study,
  .eso-home-grid .eso-home-coach,
  .eso-home-grid .eso-home-exam {
    grid-column: auto;
    grid-row: auto;
  }
}

/* Retos oficiales por bloques: enunciado íntegro y opciones por apartado. */
.official-exercise-statement {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(30, 94, 180, 0.2);
  border-radius: 16px;
  background: #f8fbff;
  line-height: 1.55;
}

.official-exercise-statement p,
.exercise-part-prompt p { margin: 0; }

.pau-reference-table {
  margin: 14px 0;
  border: 1px solid rgba(30, 94, 180, 0.22);
  border-radius: 16px;
  background: #f8fbff;
  overflow: hidden;
}

.pau-reference-table summary {
  cursor: pointer;
  padding: 12px 16px;
  color: #0b2a67;
  font-weight: 800;
}

.pau-reference-table-frame {
  min-height: 70vh;
  border-top: 1px solid rgba(30, 94, 180, 0.16);
  background: white;
}

.pau-reference-table-frame object {
  display: block;
  width: 100%;
  min-height: 70vh;
  border: 0;
}

.madrid-pau-statement-image,
.pau-official-solution-figure img {
  display: block;
  width: min(100%, 1400px);
  height: auto;
  margin: 0 auto 0.75rem;
  border-radius: 14px;
  background: #fff;
}

.madrid-pau-statement-image {
  border: 1px solid rgba(19, 74, 153, 0.18);
}

.pau-official-solution-figure {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem;
  border: 1px solid rgba(19, 74, 153, 0.18);
  border-radius: 16px;
  background: #fff;
}

.native-math {
  font-family: "Cambria Math", "STIX Two Math", serif;
  font-size: 1.08em;
  vertical-align: middle;
}

.native-math[display="block"] {
  display: block;
  max-width: 100%;
  margin: 8px auto;
  overflow-x: auto;
  overflow-y: hidden;
}

.official-display-formula {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.22em;
  max-width: 100%;
  margin: 8px auto;
  padding: 10px 14px;
  font-family: "Cambria Math", Georgia, serif;
  font-size: 1.18em;
}

.multipart-exercise-options {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.exercise-part {
  padding: 12px;
  border: 1px solid rgba(27, 91, 173, 0.18);
  border-radius: 16px;
  background: #fff;
}

.exercise-part-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

.exercise-part-heading > strong {
  min-width: 44px;
  padding: 5px 8px;
  border-radius: 10px;
  background: #eaf3ff;
  color: #1254a3;
  text-align: center;
}

.compact-part-answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.compact-part-answers .answer-btn {
  min-height: 48px;
  padding: 8px 10px;
  text-align: left;
}

.part-feedback {
  min-height: 1.2em;
  margin-top: 7px;
  color: #24466f;
  font-size: 0.88rem;
  font-weight: 700;
}

.multipart-solutions { display: grid; gap: 12px; margin-top: 10px; }
.part-solution { padding: 12px; border-radius: 14px; background: #f7fbff; }
.part-solution h3 { margin: 0 0 8px; color: #1559aa; }

@media (max-width: 720px) {
  .compact-part-answers { grid-template-columns: 1fr; }
  .exercise-part-heading { grid-template-columns: 1fr; }
  .exercise-part-heading > strong { width: fit-content; }
}

/* Keep the student access screen complete within a desktop viewport. */
@media (min-width: 821px) and (min-height: 501px) {
  html:has(.shell-compact),
  body:has(.shell-compact) {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .shell-compact {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: clamp(8px, 1.25vh, 12px);
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: clamp(8px, 1.45vh, 14px) clamp(14px, 2vw, 24px);
    overflow: hidden;
  }

  .shell-compact > .shell-stage-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .shell-compact:not(.shell-student-fit) > .shell-stage-viewport > .shell-stage {
    display: grid;
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .shell-student-fit > .shell-stage-viewport > .shell-stage {
    position: absolute;
    top: 0;
    left: 50%;
    width: 100%;
    transform: translateX(-50%) scale(1);
    transform-origin: top center;
  }

  .shell-compact > .top-strip-compact {
    width: min(1180px, 100%);
    min-height: clamp(108px, 16vh, 124px);
    margin: 0 auto;
    padding: 9px 20px 13px;
    gap: 14px;
  }

  .shell-compact .brand-block {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
    gap: 12px;
  }

  .shell-compact .brand-main {
    gap: 12px;
  }

  .shell-compact .site-title span {
    font-size: clamp(1.65rem, 2.7vw, 2.55rem);
  }

  .shell-compact .site-title small {
    min-height: 26px;
    padding: 4px 10px;
    font-size: 0.76rem;
  }

  .shell-compact .school-logo {
    width: clamp(76px, 8vw, 104px);
  }

  .shell-compact .math-word {
    min-width: 190px;
    padding: 6px 10px 7px;
  }

  .shell-compact .math-word span {
    font-size: clamp(1.05rem, 1.8vw, 1.42rem);
  }

  .shell-compact .math-word small {
    font-size: 0.66rem;
  }

  .shell-compact .corner-logo {
    width: clamp(58px, 5.4vw, 76px);
    padding: 5px;
  }

  .shell-compact .corner-logo-right {
    width: clamp(82px, 7.2vw, 106px);
  }

  .shell-compact .login-layout {
    align-self: stretch;
    align-items: center;
    width: min(500px, 100%);
    height: 100%;
    min-height: 0;
  }

  .shell-compact .login-card {
    width: 100%;
    padding: clamp(14px, 2.1vh, 20px) clamp(20px, 2.5vw, 28px);
  }

  .shell-compact .headline {
    margin-bottom: 4px;
    font-size: clamp(1.65rem, 3.2vh, 2.15rem);
    line-height: 1.05;
  }

  .shell-compact .subhead {
    margin-bottom: clamp(7px, 1.2vh, 11px);
    font-size: 0.9rem;
    line-height: 1.3;
  }

  .shell-compact .field {
    gap: 3px;
    margin-bottom: clamp(5px, 0.85vh, 8px);
  }

  .shell-compact .field label {
    font-size: 0.78rem;
  }

  .shell-compact .field select,
  .shell-compact .field input {
    min-height: clamp(36px, 5.2vh, 42px);
    padding: 7px 11px;
  }

  .shell-compact .primary {
    min-height: clamp(38px, 5.3vh, 44px);
    margin-top: 2px;
  }

  .shell-compact .error {
    min-height: 16px;
    margin: 7px 0 0;
    font-size: 0.8rem;
  }

  .shell-student-fit .student-dashboard,
  .shell-student-fit .app-grid,
  .shell-student-fit .adventure-shell,
  .shell-student-fit .path-choice-layout {
    margin-top: 0;
  }

  .shell-student-fit .screen-panel {
    padding: clamp(11px, 1.7vh, 16px);
  }

  .shell-student-fit .workspace-head {
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .shell-student-fit .workspace-head h1 {
    font-size: clamp(1.55rem, 3vh, 2.15rem);
  }

  .shell-student-fit .badge-row,
  .shell-student-fit .stat-row {
    gap: 6px;
    margin-top: 6px;
  }

  .shell-student-fit .badge,
  .shell-student-fit .stat {
    min-height: 28px;
    padding: 5px 10px;
  }

  .shell-student-fit .avatar-editor {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
  }

  .shell-student-fit .avatar-editor-grid {
    height: 100%;
    min-height: 0;
    gap: 12px;
  }

  .shell-student-fit .avatar-preview-card,
  .shell-student-fit .avatar-form {
    min-height: 0;
    height: 100%;
    gap: 8px;
    padding: 12px;
  }

  .shell-student-fit .avatar-form {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .shell-student-fit .avatar-options-grid {
    gap: 8px 10px;
  }

  .shell-student-fit .avatar-form .field {
    gap: 3px;
    margin-bottom: 0;
  }

  .shell-student-fit .avatar-form .field select,
  .shell-student-fit .avatar-form .field input {
    min-height: 38px;
    padding: 7px 10px;
  }

  .shell-student-fit .topic-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
  }

  .shell-student-fit .topic-card {
    min-height: 142px;
    padding: 10px;
    gap: 6px;
  }

  .shell-student-fit .topic-card h3 {
    font-size: 0.92rem;
    line-height: 1.15;
  }

  .shell-student-fit .topic-card p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.72rem;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .shell-student-fit .topic-card .topic-illustration {
    top: 55%;
    width: 92px;
    height: 66px;
    transform: translate(-50%, -50%);
  }

  .shell-student-fit .topic-card:hover .topic-illustration {
    transform: translate(-50%, calc(-50% - 2px));
  }

  .shell-student-fit .topic-card .topic-symbol {
    font-size: 0.9rem;
  }

  .shell-student-fit .topic-card .topic-actions {
    gap: 4px;
    flex-wrap: nowrap;
  }

  .shell-student-fit .topic-card .topic-actions button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 30px;
    padding: 5px 7px;
    font-size: 0.8rem;
    line-height: 1.05;
    white-space: normal;
  }

  .shell-student-fit .topic-level-picker {
    gap: 3px;
  }

  .shell-student-fit .topic-level-label {
    font-size: 0.66rem;
  }

  .shell-student-fit .topic-level-btn {
    min-height: 36px;
    padding: 4px 5px;
  }

  .shell-student-fit .topic-level-btn strong {
    font-size: 0.77rem;
  }

  .shell-student-fit .topic-level-btn small {
    font-size: 0.56rem;
  }

  .shell-student-fit .challenge-only .game-panel {
    min-height: 0;
  }

  .shell-student-fit .game-panel > h2 {
    margin-bottom: 6px;
    font-size: 1.08rem;
  }

  .shell-student-fit .game-panel > h2::before {
    width: 8px;
    height: 22px;
  }

  .shell-student-fit .challenge-intro {
    margin: 0 0 7px;
    font-size: 0.8rem;
    line-height: 1.25;
  }

  .shell-student-fit .question-meta {
    gap: 5px;
    margin-bottom: 6px;
  }

  .shell-student-fit .question-meta span {
    font-size: 0.7rem;
  }

  .shell-student-fit .question-text {
    margin-bottom: 8px;
    padding: 10px 12px;
    font-size: 1.05rem;
    line-height: 1.28;
  }

  .shell-student-fit .question-text.pau-open-statement {
    font-size: 1rem;
    line-height: 1.35;
  }

  .shell-student-fit .answers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .shell-student-fit .answer-btn {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 58px;
    gap: 8px;
    padding: 8px 10px;
    font-size: 0.96rem;
    line-height: 1.25;
  }

  .shell-student-fit .answer-btn > .answer-letter {
    width: 30px;
    height: 30px;
  }
}

@media (min-width: 821px) and (min-height: 501px) and (max-height: 680px) {
  .shell-compact > .top-strip-compact {
    min-height: 104px;
    padding-block: 7px 11px;
  }

  .shell-compact .login-card {
    padding-block: 11px;
  }

  .shell-compact .headline {
    font-size: 1.65rem;
  }

  .shell-compact .subhead {
    margin-bottom: 6px;
    font-size: 0.82rem;
  }

  .shell-compact .field {
    gap: 2px;
    margin-bottom: 4px;
  }

  .shell-compact .field select,
  .shell-compact .field input {
    min-height: 34px;
    padding-block: 5px;
  }

  .shell-compact .primary {
    min-height: 37px;
  }
}

@media (max-width: 820px), (max-height: 500px) {
  .shell-compact {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
}

@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;
  }
}

.topic-source {
  display: grid;
  gap: 4px;
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(21, 95, 189, 0.16);
}

.topic-source span,
.question-meta span {
  color: #52627a;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topic-source strong {
  color: #13223b;
  line-height: 1.35;
}

.challenge-intro {
  margin: -4px 0 14px;
  color: #52627a;
  font-size: 1rem;
  line-height: 1.45;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.answer-btn::before {
  display: none;
  content: none;
}

.answer-btn > .answer-letter {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-weight: 950;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.answer-btn:hover > .answer-letter,
.answer-btn.correct > .answer-letter,
.answer-btn.wrong > .answer-letter {
  background: rgba(255, 255, 255, 0.22);
}

.answer-btn > .answer-content {
  min-width: 0;
  width: auto;
  height: auto;
  display: inline;
  color: inherit;
  background: transparent;
  box-shadow: none;
  font: inherit;
}

.book-summary-lead {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf4, #f6fbff);
  border: 1px solid rgba(245, 181, 51, 0.36);
  box-shadow: 0 8px 0 rgba(245, 181, 51, 0.18), 0 18px 34px rgba(20, 43, 88, 0.12);
}

.book-summary-lead strong {
  color: #12315f;
  font-size: 1.12rem;
}

.book-summary-lead p {
  margin: 0;
  color: #334155;
  line-height: 1.58;
}

.pdf-preview {
  width: 100%;
  min-height: min(68vh, 760px);
  border: 2px solid rgba(20, 87, 184, 0.18);
  border-radius: 14px;
  background: white;
  box-shadow: 0 12px 28px rgba(20, 43, 88, 0.12);
}

.dashboard-exit {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
}

.dashboard-student {
  display: grid;
  justify-items: end;
  font-weight: 900;
  color: #12315f;
  line-height: 1.1;
}

.dashboard-student span {
  color: #64748b;
  font-size: 0.9rem;
}

.top-strip > .student-pill {
  display: none !important;
}

.admin-toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
  padding: 16px;
  border-radius: 14px;
  background: #f8fbff;
  border: 1px solid rgba(20, 87, 184, 0.14);
}

.admin-year-field,
.admin-filter {
  min-width: min(280px, 100%);
  margin: 0;
}

.admin-section {
  display: grid;
  gap: 18px;
}

.admin-search {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-search .secondary {
  width: auto;
  min-width: 150px;
}

.eso-summary ul {
  margin: 4px 0 0;
  padding-left: 22px;
  color: #172033;
  line-height: 1.6;
}

.eso-summary li {
  margin: 8px 0;
}

.source-error {
  border: 2px solid rgba(220, 53, 69, 0.22);
  background: #fff5f6;
  color: #8a1021;
  border-radius: 14px;
  padding: 16px 18px;
  font-weight: 800;
}

.sidebar-actions {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.sidebar-actions button {
  width: 100%;
}

.sidebar-actions .stop-audio-btn {
  color: #9f1239;
  border-color: rgba(190, 24, 93, 0.34);
  background: #fff1f5;
}

.topic-podcast-inline {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 17px 14px 15px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 7px 0 #0c3f7f, 0 16px 26px rgba(20, 87, 184, 0.22);
}

.topic-podcast-inline-title {
  font-size: 1.13rem;
  font-weight: 950;
  line-height: 1.15;
  text-align: center;
}

.topic-podcast-pending {
  margin: 0;
  padding: 10px 12px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 13px;
  color: #12315d;
  background: rgba(255, 255, 255, 0.9);
  font-weight: 850;
  text-align: center;
}

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

.topic-podcast-inline-options.is-master-only {
  grid-template-columns: 1fr;
}

.sidebar-actions .topic-podcast-inline-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2px 7px;
  min-height: 58px;
  padding: 8px 9px;
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-radius: 13px;
  color: #12315d;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 0 rgba(7, 48, 104, 0.38);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.topic-podcast-inline-choice > span {
  font-size: 1.1rem;
  line-height: 1;
}

.topic-podcast-inline-choice > strong {
  font-size: 0.92rem;
  line-height: 1;
  text-align: left;
}

.topic-podcast-inline-choice > small {
  grid-column: 1 / -1;
  color: #5c6f8c;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.topic-podcast-inline-choice:not(:disabled):hover,
.topic-podcast-inline-choice:not(:disabled):focus-visible {
  transform: translateY(-2px);
  border-color: #ffd66b;
  box-shadow: 0 6px 0 rgba(7, 48, 104, 0.44);
}

.topic-podcast-inline-choice.is-playing {
  border-color: #ffd34f;
  background: #fff7d8;
  box-shadow: 0 0 0 3px rgba(255, 211, 79, 0.32), 0 4px 0 rgba(7, 48, 104, 0.38);
}

.topic-podcast-inline-choice:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  box-shadow: none;
}

.topic-podcast-inline-player {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.topic-podcast-inline-player[hidden] {
  display: none;
}

.topic-podcast-inline .topic-podcast-now-playing {
  gap: 9px;
  margin: 0;
  padding: 9px;
  border-radius: 13px;
  text-align: left;
}

.topic-podcast-inline .topic-podcast-cover {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 1.15rem;
}

.topic-podcast-inline .topic-podcast-now-playing small {
  font-size: 0.63rem;
}

.topic-podcast-inline .topic-podcast-now-playing strong {
  font-size: 0.78rem;
  line-height: 1.15;
}

.sidebar-actions .topic-podcast-stop {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto;
  min-height: 38px;
  margin-left: auto;
  padding: 7px 10px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 11px;
  color: #fff;
  background: #d92d4d;
  box-shadow: 0 4px 0 #8f1531;
  font-size: 0.72rem;
  font-weight: 950;
}

.sidebar-actions .topic-podcast-stop:hover,
.sidebar-actions .topic-podcast-stop:focus-visible {
  background: #b7193a;
  transform: translateY(-1px);
}

.topic-podcast-inline audio {
  display: block;
  width: 100%;
  min-height: 42px;
}

/* Cabecera compacta del reto y ficha del alumno. */
.challenge-student-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 13px;
  border: 1px solid rgba(21, 95, 189, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 22px rgba(20, 43, 88, 0.08);
}

.challenge-student-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.challenge-course-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.challenge-course-summary small,
.challenge-score-row small {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.challenge-course-summary strong {
  color: #12315f;
  font-size: 1rem;
  line-height: 1.2;
}

.challenge-student-identity {
  display: grid;
  grid-template-columns: 50px minmax(0, auto);
  align-items: center;
  gap: 7px;
  color: #13223b;
  font-size: 0.86rem;
  text-align: right;
}

.challenge-edit-avatar {
  grid-column: 2;
  justify-self: end;
  border: 0;
  padding: 1px 4px;
  background: transparent;
  color: #1260ae;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.challenge-edit-avatar:hover,
.challenge-edit-avatar:focus-visible {
  color: #083c7d;
}

.challenge-student-avatar {
  position: relative;
  width: 50px;
  height: 50px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #dcecff, #ddf8ef);
  box-shadow: 0 4px 12px rgba(20, 87, 184, 0.18);
}

.challenge-student-avatar .avatar-figure {
  position: absolute;
  top: 0;
  left: -4px;
  transform: scale(0.48);
  transform-origin: top left;
}

.challenge-score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.challenge-score-row > span {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 7px 4px;
  border-radius: 12px;
  background: #edf5ff;
  border: 1px solid rgba(21, 95, 189, 0.12);
}

.challenge-score-row strong {
  color: #0b4d87;
  font-size: 1.04rem;
  font-variant-numeric: tabular-nums;
}

.challenge-sidebar-progress {
  margin: 11px 0 16px;
}

.challenge-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.game-panel .challenge-titlebar h2 {
  flex-wrap: wrap;
  margin: 0;
  line-height: 1.2;
}

.challenge-title-topic {
  color: #0b4d87;
}

.challenge-title-level {
  color: #7a3b00;
}

.challenge-header-timer {
  flex: 0 0 auto;
  min-width: 86px;
  justify-content: center;
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 950;
}

@media (max-width: 700px) {
  .challenge-titlebar {
    align-items: flex-start;
  }

  .game-panel .challenge-titlebar h2 {
    font-size: 1rem;
  }

  .challenge-student-identity {
    grid-template-columns: 44px;
    justify-items: center;
  }

  .challenge-student-identity > strong {
    grid-column: 1 / -1;
    text-align: center;
  }

  .challenge-edit-avatar {
    grid-column: 1 / -1;
    justify-self: center;
  }

  .challenge-student-avatar {
    width: 44px;
    height: 44px;
  }
}

body.topic-video-open {
  overflow: hidden;
}

.topic-video-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  color: #12213c;
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 207, 83, 0.22), transparent 24%),
    radial-gradient(circle at 92% 88%, rgba(24, 190, 174, 0.18), transparent 26%),
    linear-gradient(135deg, #f8fbff 0%, #edf6ff 52%, #f4fffb 100%);
}

.topic-video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 76px;
  padding: 12px clamp(18px, 3.4vw, 58px);
  color: #fff;
  background: linear-gradient(100deg, #153d82, #1268bd 54%, #078f92);
  box-shadow: 0 8px 22px rgba(12, 45, 95, 0.2);
}

.topic-video-header > div:first-child {
  display: grid;
  gap: 2px;
}

.topic-video-header span {
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topic-video-header strong {
  font-size: clamp(1.15rem, 2.1vw, 1.72rem);
  line-height: 1.05;
}

.topic-video-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topic-video-header .topic-video-duration {
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,0.42);
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
}

.topic-video-header .topic-video-close {
  width: auto;
  min-width: 108px;
  padding: 10px 18px;
  color: #123c7b;
  background: #fff;
  border-color: #fff;
  box-shadow: 0 5px 0 rgba(6, 41, 93, 0.2);
}

.topic-video-main {
  display: grid;
  grid-template-columns: minmax(310px, 0.8fr) minmax(480px, 1.35fr);
  align-items: stretch;
  gap: clamp(20px, 3vw, 54px);
  min-height: 0;
  padding: clamp(20px, 3.2vh, 38px) clamp(22px, 4.4vw, 76px);
}

.topic-video-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.topic-video-eyebrow {
  color: #087f8c;
  font-size: clamp(0.78rem, 1.1vw, 0.95rem);
  font-weight: 950;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.topic-video-copy h2 {
  margin: 10px 0 14px;
  color: #0a3978;
  font-size: clamp(1.65rem, 3.2vw, 3.25rem);
  line-height: 1.02;
  text-wrap: balance;
}

.topic-video-caption {
  max-width: 680px;
  margin: 0;
  color: #293b59;
  font-size: clamp(0.98rem, 1.3vw, 1.28rem);
  line-height: 1.55;
}

.topic-video-takeaway {
  margin-top: clamp(16px, 2.6vh, 28px);
  padding: 14px 18px;
  border: 2px solid rgba(246, 177, 48, 0.48);
  border-radius: 16px;
  color: #0b3d7c;
  background: #fff9df;
  box-shadow: 0 7px 0 rgba(246, 177, 48, 0.16);
  font-size: clamp(1rem, 1.4vw, 1.3rem);
  font-weight: 900;
  text-align: center;
}

.topic-video-stage {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  min-width: 0;
  min-height: 0;
  padding: clamp(22px, 3vw, 46px);
  overflow: hidden;
  border: 2px solid rgba(17, 95, 175, 0.16);
  border-radius: 30px;
  background:
    linear-gradient(rgba(19, 94, 173, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 94, 173, 0.045) 1px, transparent 1px),
    rgba(255,255,255,0.9);
  background-size: 34px 34px;
  box-shadow: 0 20px 48px rgba(20, 57, 105, 0.14);
}

.topic-video-stage::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -72px;
  top: -78px;
  border-radius: 50%;
  background: rgba(19, 177, 169, 0.12);
}

.video-natural-orbit {
  position: relative;
  width: min(42vh, 390px);
  aspect-ratio: 1;
  border: 3px dashed rgba(18, 102, 184, 0.22);
  border-radius: 50%;
  animation: video-pop-in 0.65s ease both;
}

.video-natural-orbit > span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: clamp(34px, 4.2vw, 54px);
  aspect-ratio: 1;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #167bc6, #584bd8);
  box-shadow: 0 7px 0 rgba(31, 65, 151, 0.24);
  font-size: clamp(1rem, 1.7vw, 1.45rem);
  font-weight: 950;
  transform: translate(-50%, -50%) rotate(calc(var(--i) * 36deg)) translateY(calc(min(21vh, 195px) * -1)) rotate(calc(var(--i) * -36deg));
  animation: video-number-arrive 0.55s calc(var(--i) * 0.07s) ease both;
}

.video-natural-core {
  position: absolute;
  inset: 27%;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  color: #0b4386;
  background: #fff8dd;
  border: 3px solid #f3b437;
  box-shadow: 0 12px 28px rgba(28, 62, 114, 0.18);
}

.video-natural-core strong {
  font-family: Georgia, serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
}

.video-natural-core small {
  font-weight: 850;
  text-align: center;
}

.video-use-cards {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.video-use-cards span {
  padding: 8px 12px;
  border-radius: 12px;
  background: #eaf5ff;
  color: #174b86;
  font-weight: 800;
}

.video-use-cards b { color: #df4262; }

.video-place-number {
  color: #0c4286;
  font-size: clamp(2.6rem, 7vw, 6.4rem);
  font-weight: 950;
  letter-spacing: 0.05em;
  line-height: 1;
  animation: video-pop-in 0.55s ease both;
}

.video-place-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(60px, 1fr));
  width: min(100%, 780px);
  border: 2px solid #c9def4;
  border-radius: 17px;
  overflow: hidden;
  background: #fff;
}

.video-place-grid > div {
  display: grid;
  gap: 3px;
  padding: 9px 6px;
  border-right: 1px solid #d7e7f5;
  text-align: center;
  animation: video-rise-in 0.45s calc(var(--delay) * 0.09s) ease both;
}

.video-place-grid > div:last-child { border-right: 0; }
.video-place-grid small { color: #667896; font-weight: 900; }
.video-place-grid strong { color: #0c61b1; font-size: clamp(1.5rem, 3vw, 2.6rem); }
.video-place-grid span { color: #263b5b; font-size: clamp(0.72rem, 1vw, 0.9rem); font-weight: 800; }

.video-expanded-number {
  padding: 12px 18px;
  border-radius: 14px;
  color: #174c86;
  background: #edf7ff;
  font-size: clamp(1rem, 1.8vw, 1.55rem);
  font-weight: 900;
  text-align: center;
}

.video-comparison {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 24px);
  color: #0d4488;
  font-size: clamp(1.8rem, 4vw, 3.8rem);
  font-weight: 950;
  animation: video-pop-in 0.55s ease both;
}

.video-comparison b { color: #df3f60; }

.video-number-line {
  position: relative;
  width: min(88%, 720px);
  height: 94px;
}

.video-number-line-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 40px;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, #1aa99f, #1268bd);
}

.video-number-line-track::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  border-left: 18px solid #1268bd;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  transform: translateY(-50%);
}

.video-number-line > span {
  position: absolute;
  left: var(--position);
  top: 18px;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: #193d70;
  font-weight: 900;
  transform: translateX(-50%);
}

.video-number-line > span::after {
  content: "";
  width: 5px;
  height: 34px;
  border-radius: 4px;
  background: #f0ab31;
}

.video-direction { margin: -16px 0 0; color: #5b6d88; font-weight: 850; }
.video-direction span { color: #e34a67; font-size: 1.5rem; }

.video-operation-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2.2vw, 28px);
  width: min(100%, 780px);
}

.video-operation-pair article {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 210px;
  padding: 24px 16px 18px;
  border: 2px solid #d6e7f7;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 0 rgba(22, 96, 173, 0.1);
  text-align: center;
  animation: video-rise-in 0.55s ease both;
}

.video-operation-pair article:nth-child(2) { animation-delay: 0.15s; }

.video-op-symbol {
  display: grid;
  place-items: center;
  width: 64px;
  aspect-ratio: 1;
  margin-top: -50px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #ef4b68, #f0aa30);
  box-shadow: 0 7px 0 rgba(187, 74, 61, 0.2);
  font-size: 2rem;
  font-weight: 950;
}

.video-operation-pair small { color: #087f8c; font-weight: 950; letter-spacing: 0.05em; }
.video-operation-pair strong { color: #123f7c; font-size: clamp(1.35rem, 2.4vw, 2.15rem); }
.video-operation-pair p { margin: 0; color: #526780; font-weight: 800; }

.video-check-pill,
.video-division-rule {
  padding: 11px 16px;
  border-radius: 14px;
  color: #0b6d68;
  background: #e7faf5;
  border: 1px solid #9dded1;
  font-size: clamp(0.92rem, 1.35vw, 1.18rem);
  font-weight: 900;
  text-align: center;
}

.video-division-rule { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; }
.video-division-rule b { color: #df4262; }

.video-priority-stack {
  display: grid;
  gap: 10px;
  width: min(100%, 650px);
}

.video-priority-stack > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 18px;
  border: 2px solid #d7e6f4;
  border-radius: 15px;
  background: #fff;
  animation: video-slide-in 0.48s ease both;
}

.video-priority-stack > div:nth-child(2) { animation-delay: 0.18s; }
.video-priority-stack > div:nth-child(3) { animation-delay: 0.36s; }
.video-priority-stack > div:nth-child(4) { animation-delay: 0.54s; }
.video-priority-stack small { color: #087f8c; font-weight: 950; }
.video-priority-stack strong { color: #163e76; font-size: clamp(1.15rem, 2.4vw, 2rem); }
.video-priority-stack mark { padding: 2px 6px; border-radius: 7px; color: #92304a; background: #ffe3a3; }
.video-priority-stack .is-result { color: #fff; background: linear-gradient(100deg, #1267b8, #0b9a90); border-color: transparent; }
.video-priority-stack .is-result small,
.video-priority-stack .is-result strong { color: #fff; }

.video-recap-wheel {
  position: relative;
  width: min(42vh, 390px);
  aspect-ratio: 1;
  border: 3px dashed rgba(18, 102, 184, 0.2);
  border-radius: 50%;
}

.video-recap-center {
  position: absolute;
  inset: 30%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #176fc0, #08978e);
  font-family: Georgia, serif;
  font-size: clamp(2.3rem, 5vw, 4.5rem);
  box-shadow: 0 12px 28px rgba(28, 62, 114, 0.22);
}

.video-recap-wheel > span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: clamp(80px, 8.5vw, 120px);
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 13px;
  color: #154882;
  background: #fff;
  border: 2px solid #cce1f4;
  box-shadow: 0 6px 0 rgba(17, 93, 168, 0.12);
  font-weight: 900;
  text-align: center;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(min(19vh, 175px) * -1)) rotate(calc(var(--angle) * -1));
  animation: video-number-arrive 0.5s ease both;
}

.video-recap-wheel > span:nth-of-type(2) { animation-delay: 0.08s; }
.video-recap-wheel > span:nth-of-type(3) { animation-delay: 0.16s; }
.video-recap-wheel > span:nth-of-type(4) { animation-delay: 0.24s; }
.video-recap-wheel > span:nth-of-type(5) { animation-delay: 0.32s; }
.video-recap-wheel > span:nth-of-type(6) { animation-delay: 0.4s; }

.video-ready-message {
  color: #0b6d68;
  font-size: clamp(1.2rem, 2.1vw, 1.8rem);
  font-weight: 950;
}

.video-topic-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: min(34vh, 300px);
  aspect-ratio: 1;
  border-radius: 34% 66% 58% 42% / 44% 38% 62% 56%;
  color: #fff;
  background: linear-gradient(145deg, #155fba, #078f92);
  box-shadow: 0 18px 0 rgba(14, 91, 163, 0.12), 0 30px 48px rgba(17, 67, 126, 0.18);
  animation: video-emblem-float 4s ease-in-out infinite;
}

.video-topic-emblem::before,
.video-topic-emblem::after {
  content: "";
  position: absolute;
  inset: -18px;
  border: 3px dashed rgba(242, 176, 52, 0.5);
  border-radius: inherit;
  transform: rotate(8deg);
}

.video-topic-emblem::after {
  inset: 12px;
  border: 2px solid rgba(255,255,255,0.34);
  transform: rotate(-5deg);
}

.video-topic-emblem span {
  position: relative;
  z-index: 1;
  max-width: 84%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.video-topic-keywords {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.video-topic-keywords span {
  padding: 8px 14px;
  border: 2px solid #cce2f3;
  border-radius: 999px;
  color: #154a86;
  background: #fff;
  box-shadow: 0 5px 0 rgba(19, 91, 165, 0.1);
  font-weight: 900;
  animation: video-rise-in 0.45s calc(var(--delay) * 0.1s) ease both;
}

.video-topic-route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #0c726e;
  font-size: 0.8rem;
  font-weight: 900;
}

.video-topic-route i {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f1ad32;
}

.video-concept-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.8vw, 20px);
  width: min(100%, 780px);
}

.video-concept-grid article {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 12px;
  min-height: 150px;
  padding: 17px 18px;
  border: 2px solid #d6e6f5;
  border-radius: 19px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 8px 0 rgba(19, 94, 171, 0.09);
  animation: video-rise-in 0.48s calc(var(--delay) * 0.12s) ease both;
}

.video-concept-grid article > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #ec4767, #f1ac32);
  box-shadow: 0 5px 0 rgba(180, 75, 59, 0.16);
  font-weight: 950;
}

.video-concept-grid strong {
  color: #0b498f;
  font-size: clamp(0.98rem, 1.35vw, 1.18rem);
}

.video-concept-grid p {
  margin: 5px 0 0;
  color: #4e607b;
  font-size: clamp(0.76rem, 1.05vw, 0.94rem);
  line-height: 1.38;
}

.video-method-path {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(100%, 720px);
}

.video-method-path::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 26px;
  bottom: 26px;
  width: 5px;
  border-radius: 99px;
  background: linear-gradient(#f0aa31, #0b9a90);
}

.video-method-path > div {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 10px 18px 10px 0;
  border: 2px solid #d7e6f4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 7px 0 rgba(20, 91, 162, 0.09);
  animation: video-slide-in 0.46s calc(var(--delay) * 0.16s) ease both;
}

.video-method-path span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  margin-left: 2px;
  border-radius: 50%;
  color: #fff;
  background: #1268b9;
  border: 4px solid #eef7ff;
  font-weight: 950;
}

.video-method-path p {
  margin: 0;
  color: #183e70;
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  font-weight: 850;
}

.video-example-expression {
  width: min(100%, 760px);
  padding: 18px 22px;
  border: 3px solid rgba(242, 176, 52, 0.62);
  border-radius: 20px;
  color: #0a4489;
  background: #fff8dc;
  box-shadow: 0 9px 0 rgba(241, 175, 49, 0.14);
  font-size: clamp(1.25rem, 2.7vw, 2.35rem);
  font-weight: 950;
  text-align: center;
  animation: video-pop-in 0.48s ease both;
}

.video-example-steps {
  display: grid;
  gap: 10px;
  width: min(100%, 760px);
}

.video-example-steps > div {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  color: #173f76;
  background: #fff;
  border: 2px solid #d5e6f5;
  animation: video-slide-in 0.42s calc(var(--delay) * 0.16s) ease both;
}

.video-example-steps small {
  color: #078a87;
  font-weight: 950;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.video-example-steps strong {
  font-size: clamp(0.98rem, 1.55vw, 1.3rem);
}

.video-check-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.4vw, 28px);
  width: min(100%, 780px);
}

.video-check-cards article {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 280px;
  padding: 26px 22px;
  border-radius: 24px;
  border: 3px solid transparent;
  text-align: center;
  box-shadow: 0 12px 0 rgba(22, 77, 137, 0.09);
  animation: video-rise-in 0.5s ease both;
}

.video-check-cards article:nth-child(2) { animation-delay: 0.16s; }
.video-check-cards .is-warning { color: #803040; background: #fff1f1; border-color: #ffc0c8; }
.video-check-cards .is-success { color: #075f5d; background: #eafff8; border-color: #a6e4d7; }

.video-check-cards article > span {
  display: grid;
  place-items: center;
  width: 66px;
  aspect-ratio: 1;
  border-radius: 20px;
  color: #fff;
  background: #e34762;
  font-size: 2rem;
  font-weight: 950;
}

.video-check-cards .is-success > span { background: #079589; }
.video-check-cards small { font-weight: 950; letter-spacing: 0.05em; }
.video-check-cards p { margin: 0; font-size: clamp(0.9rem, 1.2vw, 1.08rem); line-height: 1.45; font-weight: 750; }

.video-topic-recap-wheel > span {
  animation-delay: calc(var(--delay) * 0.08s);
}

@keyframes video-emblem-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.topic-video-controls {
  display: grid;
  gap: 9px;
  padding: 12px clamp(18px, 3.4vw, 58px) 14px;
  border-top: 1px solid rgba(17, 91, 170, 0.15);
  background: rgba(255,255,255,0.94);
  box-shadow: 0 -10px 28px rgba(18, 53, 99, 0.08);
}

.topic-video-progress {
  display: grid;
  grid-template-columns: repeat(var(--scene-count, 7), 1fr);
  gap: 7px;
}

.topic-video-progress button {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  color: #6a7a91;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.topic-video-progress button span {
  flex: 1;
  height: 7px;
  border-radius: 99px;
  background: #d8e5f3;
}

.topic-video-progress button.is-viewed span { background: #54bbae; }
.topic-video-progress button.is-current span { background: linear-gradient(90deg, #f04b68, #efb133); }
.topic-video-progress button small { font-weight: 900; }

.topic-video-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.topic-video-buttons button {
  width: auto;
  min-width: 126px;
  padding: 9px 16px;
}

.topic-video-buttons .topic-video-play { min-width: 150px; }
.topic-video-status { color: #63738b; font-size: 0.78rem; font-weight: 800; text-align: center; }

@keyframes video-pop-in {
  from { opacity: 0; transform: scale(0.72); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes video-number-arrive {
  from { opacity: 0; filter: blur(4px); }
  to { opacity: 1; filter: blur(0); }
}

@keyframes video-rise-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes video-slide-in {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 920px) {
  .topic-video-main {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 16px;
    padding: 16px 18px;
  }
  .topic-video-caption { font-size: 0.92rem; line-height: 1.42; }
  .topic-video-copy h2 { font-size: clamp(1.45rem, 3.2vw, 2.1rem); }
  .topic-video-stage { padding: 18px; border-radius: 22px; }
  .topic-video-buttons button { min-width: 0; padding: 8px 11px; }
}

@media (max-width: 700px), (max-height: 610px) {
  .topic-video-header { min-height: 58px; padding-block: 8px; }
  .topic-video-header .topic-video-duration { display: none; }
  .topic-video-main { grid-template-columns: 0.85fr 1.15fr; padding-block: 10px; }
  .topic-video-copy h2 { margin: 6px 0 8px; }
  .topic-video-caption { font-size: 0.82rem; line-height: 1.34; }
  .topic-video-takeaway { margin-top: 10px; padding: 8px 10px; font-size: 0.86rem; }
  .topic-video-stage { gap: 10px; padding: 12px; }
  .topic-video-controls { gap: 5px; padding-block: 7px; }
  .topic-video-status { display: none; }
  .video-operation-pair article { min-height: 150px; padding: 20px 10px 10px; gap: 5px; }
  .video-op-symbol { width: 46px; margin-top: -38px; font-size: 1.4rem; }
  .video-natural-orbit, .video-recap-wheel { width: min(38vh, 300px); }
  .video-topic-emblem { width: min(31vh, 250px); }
  .video-concept-grid article { min-height: 116px; padding: 11px 12px; }
  .video-check-cards article { min-height: 190px; padding: 16px; }
}

@media (max-width: 620px) {
  .topic-video-main { grid-template-columns: 1fr; overflow: auto; }
  .topic-video-copy { justify-content: start; }
  .topic-video-stage { min-height: 390px; }
  .topic-video-buttons { flex-wrap: wrap; }
  .topic-video-progress small { display: none; }
}

.challenge-only {
  grid-template-columns: minmax(0, 1fr);
}

.lesson-modal {
  display: none;
  position: fixed;
  z-index: 30;
  inset: 28px;
  width: auto;
  max-width: 980px;
  max-height: calc(100vh - 56px);
  margin: 0 auto;
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 80px rgba(12, 27, 54, 0.28);
}

.lesson-modal::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: -28px;
  background: rgba(10, 20, 38, 0.28);
}

body.lesson-infographic-open {
  overflow: hidden;
}

.lesson-modal.lesson-modal-infographic {
  position: fixed !important;
  z-index: 1000;
  inset: 0 !important;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  grid-template-rows: minmax(0, 1fr);
  background: #eef5ff;
}

.lesson-modal.lesson-modal-infographic::before,
.lesson-modal.lesson-modal-infographic > h2,
.lesson-modal.lesson-modal-infographic > .topic-summary-card,
.lesson-modal.lesson-modal-infographic > #book-content-panel {
  display: none !important;
}

.lesson-modal-infographic .topic-explanation-detail {
  display: grid !important;
  width: 100%;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 0;
}

.lesson-modal-infographic .infographic-fullscreen-panel {
  width: 100%;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 12px 16px 16px;
  border: 0;
  border-radius: 0;
  grid-template-rows: auto minmax(0, 1fr);
  background: #eef5ff;
  box-shadow: none;
}

.lesson-modal-infographic .book-content-head {
  min-height: 58px;
  padding: 0 4px 10px;
}

.lesson-modal-infographic .book-content-head strong {
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.lesson-modal-infographic .infographic-close-btn {
  min-width: 120px;
}

.lesson-modal-infographic .infographic-fullscreen-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 10px;
  background: #fff;
}

.modal-close {
  justify-self: end;
  width: auto;
  min-width: 120px;
}

.challenge-only .game-panel {
  min-height: calc(100vh - 130px);
}

.result-review {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  text-align: left;
}

.result-review h2 {
  margin: 0;
}

.review-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: #f8fbff;
  border: 1px solid rgba(21, 95, 189, 0.16);
}

.review-item p {
  margin: 8px 0;
  color: #13223b;
  font-weight: 800;
}

.review-item small {
  color: #52627a;
  line-height: 1.45;
}

/* Header refresh: keeps the institutional identity but makes the top feel alive. */
.top-strip {
  display: grid;
  grid-template-columns: minmax(72px, 118px) minmax(0, 1fr) minmax(92px, 138px);
  align-items: center;
  gap: 18px;
  width: min(1320px, 100%);
  min-height: 138px;
  padding: 16px 26px;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(246, 183, 60, 0.28), transparent 26%),
    radial-gradient(circle at 82% 16%, rgba(0, 168, 120, 0.22), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #f4f8ff 48%, #eefbf7 100%);
  border: 1px solid rgba(20, 87, 184, 0.12);
  box-shadow: 0 8px 0 rgba(20, 87, 184, 0.08), 0 22px 46px rgba(20, 43, 88, 0.16);
  backdrop-filter: none;
}

.top-strip::before {
  content: "";
  position: absolute;
  inset: auto 18px 12px 18px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--red), var(--gold), var(--green), var(--blue));
  opacity: 0.95;
}

.top-strip::after {
  content: "∑  π  √  ∫  Δ  =";
  position: absolute;
  right: 28px;
  top: 14px;
  color: rgba(20, 87, 184, 0.1);
  font-size: 1.3rem;
  font-weight: 950;
  letter-spacing: 12px;
  pointer-events: none;
}

.brand-block {
  position: relative;
  z-index: 1;
  gap: 8px;
}

.brand-main {
  gap: 20px;
}

.site-title {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
  color: #11203a;
  font-size: 1.15rem;
  font-weight: 950;
  line-height: 1.05;
}

.site-title span {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(20, 87, 184, 0.14);
  color: #12315f;
}

.site-title small {
  color: #52627a;
  font-size: 0.82rem;
  font-weight: 900;
}

.math-word {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.35vw, 18px);
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  line-height: 0.95;
}

.math-word span {
  display: inline-grid;
  place-items: center;
  min-width: 0.68em;
  transform: translateY(0);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.top-strip:hover .math-word span:nth-child(odd) {
  transform: translateY(-3px);
}

.top-strip:hover .math-word span:nth-child(even) {
  transform: translateY(2px);
}

.school-logo-link {
  padding: 8px 10px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(20, 87, 184, 0.12);
  box-shadow: 0 6px 0 rgba(20, 87, 184, 0.1);
}

.school-logo {
  width: clamp(82px, 7vw, 106px);
  max-height: 106px;
}

.corner-logo {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  z-index: 1;
  justify-self: start;
  width: clamp(66px, 6vw, 92px);
  padding: 7px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(20, 87, 184, 0.12);
}

.corner-logo-right {
  justify-self: end;
  width: clamp(90px, 8vw, 126px);
}

.student-pill {
  right: 20px;
  bottom: 26px;
  z-index: 2;
}

/* Blue academy direction for the first screen. */
.top-strip {
  grid-template-columns: minmax(70px, 104px) minmax(0, 1fr) minmax(86px, 124px);
  min-height: 142px;
  padding: 14px 26px 18px;
  color: #ffffff;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.2), transparent 26%),
    radial-gradient(circle at 84% 16%, rgba(0, 159, 122, 0.36), transparent 26%),
    linear-gradient(135deg, #082f68 0%, #155fbd 50%, #078f9f 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 0 rgba(8, 47, 104, 0.12), 0 28px 54px rgba(11, 52, 116, 0.22);
}

.top-strip::before {
  inset: auto 26px 16px 26px;
  height: 5px;
  background: linear-gradient(90deg, rgba(255,255,255,0.18), rgba(255,255,255,0.82), rgba(242,176,52,0.92), rgba(255,255,255,0.22));
}

.top-strip::after {
  content: "x²   π   √   ∑   Δ";
  color: rgba(255, 255, 255, 0.14);
  font-size: clamp(1.2rem, 2.4vw, 2.2rem);
  top: 18px;
  right: 34px;
}

.brand-block {
  justify-items: center;
  gap: 6px;
}

.brand-main {
  width: 100%;
  justify-content: center;
  gap: 18px;
}

.site-title {
  justify-items: center;
  text-align: center;
  color: #ffffff;
}

.site-title span {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  font-size: clamp(2.1rem, 4.1vw, 3.85rem);
  letter-spacing: 0;
  line-height: 0.95;
  text-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.site-title small {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 999px;
  color: #dcecff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: clamp(0.82rem, 1.2vw, 1rem);
}

.math-word {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 6px 14px 8px;
  border-radius: 14px;
  color: #0b3474;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.56);
  box-shadow: 0 8px 0 rgba(8, 47, 104, 0.16), 0 16px 30px rgba(8, 47, 104, 0.18);
}

.math-word span {
  min-width: 0;
  color: #0b3474;
  font-size: clamp(1.28rem, 2.45vw, 2.25rem);
  font-weight: 950;
  line-height: 0.94;
  letter-spacing: 0.06em;
  animation: none;
}

.math-word small {
  color: #155fbd;
  font-size: clamp(0.66rem, 0.9vw, 0.8rem);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.top-strip:hover .math-word span:nth-child(odd),
.top-strip:hover .math-word span:nth-child(even) {
  transform: none;
}

.school-logo-link,
.corner-logo {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.46);
}

.school-logo {
  width: clamp(92px, 9vw, 128px);
}

.brand-main .school-logo-link {
  width: clamp(88px, 7.2vw, 106px);
  height: clamp(88px, 7.2vw, 106px);
  padding: 8px;
  place-items: center;
  align-self: center;
  box-sizing: border-box;
}

.brand-main .school-logo {
  width: 100%;
  max-width: 88px;
  max-height: 88px;
}

/* Institutional logos: equal side boxes and fully visible artwork. */
.top-strip .corner-logo,
.shell-compact .top-strip .corner-logo,
.top-strip .corner-logo-right,
.shell-compact .top-strip .corner-logo-right {
  width: clamp(86px, 6.8vw, 96px);
  height: clamp(86px, 6.8vw, 96px);
  padding: 9px;
  object-fit: contain;
  object-position: center;
  border-radius: 14px;
}

.top-strip .corner-logo-left {
  justify-self: start;
  padding-inline: 7px;
}

.top-strip .corner-logo-right {
  justify-self: end;
}

/* Keep the app mark clearly above the decorative line. */
.top-strip .brand-main .school-logo-link {
  position: relative;
  top: -5px;
  width: clamp(72px, 5.4vw, 84px);
  height: clamp(72px, 5.4vw, 84px);
  padding: 9px;
  place-items: center;
}

.top-strip .brand-main .school-logo {
  width: 100%;
  height: 100%;
  max-width: 64px;
  max-height: 64px;
  object-fit: contain;
  object-position: center;
}

.path-choice {
  min-height: 350px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 0 rgba(8, 47, 104, 0.12), 0 24px 44px rgba(11, 52, 116, 0.18);
}

.path-choice-study,
.path-choice-adventure {
  background:
    radial-gradient(circle at 14% 15%, rgba(255,255,255,0.2), transparent 24%),
    radial-gradient(circle at 84% 18%, rgba(0,159,122,0.3), transparent 28%),
    linear-gradient(135deg, #0b3474 0%, #155fbd 52%, #078f9f 100%);
}

.path-choice-study {
  background:
    radial-gradient(circle at 12% 16%, rgba(242,176,52,0.28), transparent 24%),
    radial-gradient(circle at 86% 12%, rgba(255,255,255,0.18), transparent 24%),
    linear-gradient(135deg, #0b3474 0%, #155fbd 58%, #1d7fc3 100%);
}

.path-choice h2 {
  color: #ffffff;
  font-size: clamp(2.05rem, 3.8vw, 3.35rem);
}

.path-choice p,
.path-choice-adventure p {
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 1.45vw, 1.18rem);
}

.path-icon,
.path-choice-adventure .path-icon {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}

.path-choice .primary,
.path-choice .secondary {
  width: auto;
  justify-self: start;
  padding-inline: 22px;
  color: #0b3474;
  background: #ffffff;
  box-shadow: 0 6px 0 rgba(8, 47, 104, 0.34), 0 16px 28px rgba(8, 47, 104, 0.22);
}

.path-choice .primary:hover,
.path-choice .secondary:hover {
  color: #0b3474;
  background: #fff8df;
}

.path-choice .mini-stats span {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.block-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  width: 100%;
  height: 100%;
  min-height: 0;
}

.block-choice-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 0;
  text-align: center;
  overflow: hidden;
}

.block-choice-card h2 {
  width: 100%;
  max-width: 18ch;
  margin-inline: auto;
  font-size: clamp(1.55rem, 2.6vw, 2.35rem);
  line-height: 1.08;
}

.block-slot-left-top {
  grid-column: 1;
  grid-row: 1;
}

.block-slot-left-bottom {
  grid-column: 1;
  grid-row: 2;
}

.block-slot-right-top {
  grid-column: 2;
  grid-row: 1;
}

.block-slot-right-bottom {
  grid-column: 2;
  grid-row: 2;
}

.block-choice-card .path-icon {
  display: none;
}

@media (min-width: 561px) and (min-height: 421px) {
  .bach-block-selector,
  .bach-block-selector-panel {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
  }

  .bach-block-selector-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .bach-block-selector .workspace-head {
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .bach-block-selector .block-choice-grid {
    height: 100%;
    gap: clamp(10px, 1.5vh, 16px);
  }

  .bach-block-selector .block-choice-card {
    height: 100%;
    padding: clamp(10px, 1.5vh, 16px);
    gap: clamp(5px, 0.8vh, 10px);
  }

  .bach-block-selector .block-choice-card p {
    margin-block: 0;
    font-size: clamp(0.82rem, 1.2vw, 1rem);
    line-height: 1.3;
  }

  .bach-block-selector .block-choice-card .secondary {
    justify-self: center;
    align-self: center;
    padding: 8px 16px;
    min-height: 38px;
  }
}

.shell-student-fit,
.shell-student-fit > .shell-stage-viewport {
  max-width: 100vw;
  overflow-x: hidden;
}

@media (max-width: 560px), (max-height: 420px) {
  .block-choice-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto;
  }

  .block-choice-card {
    grid-column: auto;
    grid-row: auto;
  }

  .top-strip {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 18px 18px 28px;
  }

  .corner-logo,
  .corner-logo-right {
    display: none;
  }

  .brand-main {
    flex-direction: column-reverse;
  }

  .site-title {
    justify-items: center;
    text-align: center;
  }

  .math-word {
    flex-wrap: wrap;
    font-size: 2.05rem;
  }
}

@media (max-width: 980px) {
  .path-choice-grid,
  .adventure-shell,
  .zone-entry-layout,
  .avatar-editor-grid,
  .training-lanes,
  .teacher-prep {
    grid-template-columns: 1fr;
  }

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

  .block-choice-card {
    min-height: 0;
  }

  .avatar-panel {
    position: static;
  }
}

@media (max-width: 560px), (max-height: 420px) {
  .block-choice-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .block-choice-card {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .zone-entry-scene {
    min-height: 390px;
  }

  .zone-scene-landmark {
    top: 39%;
  }

  .zone-scene-landmark .zone-visual {
    width: 240px;
    height: 170px;
  }

  .zone-scene-avatar {
    right: 4px;
    bottom: 94px;
    transform: scale(0.5);
  }

  .zone-scene-copy {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .adventure-map-board {
    min-height: 0;
    display: grid;
    gap: 12px;
    padding: 14px;
  }

  .map-route-line {
    inset: 22px auto 22px 40px;
    width: 4px;
    background: rgba(11, 52, 116, 0.18);
    border-radius: 999px;
  }

  .map-route-svg {
    display: none;
  }

  .map-node,
  .map-node.zone-1,
  .map-node.zone-2,
  .map-node.zone-3,
  .map-node.zone-4,
  .map-node.zone-5,
  .map-node.zone-6,
  .map-node.zone-7,
  .map-node.zone-8,
  .map-node.zone-9,
  .map-node.zone-10 {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    min-height: 96px;
    grid-template-columns: 52px minmax(0, 1fr);
    justify-items: start;
    text-align: left;
    transform: none;
    display: grid;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.88);
  }

  .map-node[style] {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    min-height: 104px;
    transform: none;
  }

  .map-node:hover:not(:disabled),
  .map-node:focus-visible:not(:disabled) {
    transform: translateY(-2px);
  }

  .map-node::before {
    display: none;
  }

  .map-node .zone-visual {
    grid-row: 1 / span 2;
    width: 84px;
    height: 62px;
  }

  .map-node-label {
    width: 100%;
    min-height: 0;
    padding: 7px 9px;
    text-align: left;
  }

  .map-node-label strong { font-size: 0.86rem; }
  .map-node-label small { font-size: 0.72rem; }

  .map-node .zone-orb {
    left: 4px;
    top: 4px;
  }

  .map-zone {
    grid-template-columns: 1fr;
  }

  .zone-orb {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .map-node .zone-orb {
    left: 4px;
    top: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
  }

  .phase-row .compact-btn {
    width: 100%;
  }

  .dashboard-exit {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

/* +MathUp brand system ----------------------------------------------------- */
:root {
  --brand-navy: #061a57;
  --brand-navy-deep: #03103d;
  --brand-blue: #075cff;
  --brand-blue-bright: #168cff;
  --brand-gold: #ffbf00;
  --brand-ice: #eef6ff;
  --ink: #111d3b;
  --ink-soft: #263b66;
  --muted: #5a6c8d;
  --line: rgba(7, 92, 255, 0.15);
  --panel: rgba(255, 255, 255, 0.95);
  --paper: #f8fbff;
  --blue: var(--brand-blue);
  --blue-deep: var(--brand-navy);
  --gold: var(--brand-gold);
  --sky: var(--brand-ice);
  --violet: #244fd8;
  --shadow: 0 20px 48px rgba(3, 24, 78, 0.15);
  --shadow-tight: 0 0 0 1px rgba(7, 92, 255, 0.08), 0 12px 24px rgba(3, 24, 78, 0.12);
  --lift: 0 0 0 1px rgba(255, 255, 255, 0.78), 0 18px 38px rgba(3, 24, 78, 0.14);
}

body {
  background:
    linear-gradient(rgba(7, 92, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 92, 255, 0.04) 1px, transparent 1px),
    radial-gradient(circle at 12% 8%, rgba(22, 140, 255, 0.1), transparent 28%),
    linear-gradient(135deg, #f5f9ff 0%, #ffffff 52%, #eef5ff 100%);
  background-size: 34px 34px, 34px 34px, auto, auto;
}

body::before {
  color: rgba(7, 92, 255, 0.055);
}

.top-strip.mathup-header,
.shell-compact .top-strip.mathup-header {
  display: block;
  width: min(1320px, 100%);
  height: clamp(112px, 10vw, 140px);
  min-height: 0;
  aspect-ratio: auto;
  padding: 10px clamp(18px, 2.5vw, 34px) 14px;
  overflow: hidden;
  color: #ffffff;
  border: 0;
  border-radius: clamp(18px, 2.2vw, 30px);
  background: var(--brand-navy);
  box-shadow: 0 10px 0 rgba(3, 16, 61, 0.12), 0 24px 50px rgba(3, 24, 78, 0.24);
  backdrop-filter: none;
}

.shell-student-fit .top-strip.mathup-header {
  width: min(1320px, 100%);
  height: clamp(96px, 9vw, 118px);
}

.top-strip.mathup-header::before {
  display: none;
}

.top-strip.mathup-header::after {
  display: none;
}

.mathup-header-layout {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) minmax(250px, 0.78fr);
  align-items: center;
  justify-items: center;
  gap: clamp(18px, 3vw, 46px);
  width: 100%;
  height: 100%;
}

.mathup-crop {
  position: relative;
  display: block;
  overflow: hidden;
}

.mathup-crop img {
  position: absolute;
  display: block;
  max-width: none;
  height: auto;
}

.mathup-crop-icon {
  width: clamp(72px, 7.5vw, 104px);
  aspect-ratio: 250 / 234;
  border-radius: 22%;
}

.mathup-crop-icon img {
  top: -105.6%;
  left: -47.6%;
  width: 838.4%;
}

.mathup-crop-wordmark {
  width: clamp(300px, 34vw, 440px);
  max-width: 100%;
  aspect-ratio: 843 / 252;
}

.mathup-crop-wordmark img {
  top: -94.4%;
  left: -55%;
  width: 248.6%;
}

.mathup-crop-tagline {
  width: min(100%, 360px);
  aspect-ratio: 630 / 88;
}

.mathup-crop-tagline img {
  top: -379.5%;
  left: -214.9%;
  width: 332.7%;
}

.top-strip,
.login-card,
.screen-panel,
.topic-card,
.question-box,
.admin-table,
.topic-podcast-card {
  border-color: rgba(7, 92, 255, 0.12);
}

.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-bright));
  box-shadow: 0 6px 0 #043dbe, 0 16px 28px rgba(7, 92, 255, 0.24);
}

.primary:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #034bd8, #087ee8);
  box-shadow: 0 8px 0 #032d91, 0 20px 32px rgba(7, 92, 255, 0.28);
}

.secondary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-blue));
  box-shadow: 0 6px 0 var(--brand-navy-deep), 0 16px 28px rgba(3, 24, 78, 0.24);
}

.secondary:hover {
  color: #ffffff;
  background: linear-gradient(135deg, #0a2b79, var(--brand-blue-bright));
  box-shadow: 0 8px 0 var(--brand-navy-deep), 0 20px 32px rgba(3, 24, 78, 0.27);
}

.ghost {
  color: var(--brand-navy);
  border-color: rgba(7, 92, 255, 0.18);
  background: var(--brand-ice);
  box-shadow: 0 5px 0 #c4d9fa, 0 12px 20px rgba(3, 24, 78, 0.12);
}

.ghost:hover {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-blue));
  box-shadow: 0 7px 0 var(--brand-navy-deep), 0 18px 28px rgba(3, 24, 78, 0.2);
}

.primary:focus-visible,
.secondary:focus-visible,
.ghost:focus-visible,
.answer-btn:focus-visible,
.course-btn:focus-visible,
button:focus-visible,
a:focus-visible {
  outline-color: rgba(255, 191, 0, 0.82);
}

.student-pill,
.topic-podcast-option.is-express,
.topic-podcast-option.is-master {
  background: linear-gradient(135deg, var(--brand-navy), var(--brand-blue));
}

.path-choice,
.path-choice-study,
.path-choice-adventure {
  background:
    radial-gradient(circle at 14% 14%, rgba(255, 191, 0, 0.22), transparent 25%),
    radial-gradient(circle at 86% 12%, rgba(22, 140, 255, 0.25), transparent 28%),
    linear-gradient(135deg, var(--brand-navy-deep) 0%, var(--brand-navy) 48%, var(--brand-blue) 100%);
}

.path-choice .primary,
.path-choice .secondary {
  color: var(--brand-navy);
  background: #ffffff;
  box-shadow: 0 6px 0 rgba(3, 16, 61, 0.42), 0 16px 28px rgba(3, 16, 61, 0.24);
}

.path-choice .primary:hover,
.path-choice .secondary:hover {
  color: var(--brand-navy);
  background: #fff6d8;
}

.bach-pau-community-control {
  display: grid;
  gap: 7px;
  width: min(100%, 360px);
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(0.82rem, 0.8vw, 1rem);
  font-weight: 800;
}

.bach-pau-card-actions {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  width: 100%;
  margin-top: auto;
}

.bach-pau-card-actions .bach-pau-community-control {
  flex: 1 1 260px;
  min-width: 0;
}

.bach-pau-card-actions > button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.bach-pau-community-control select {
  width: 100%;
  min-height: 46px;
  padding: 8px 38px 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: #082461;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.bach-pau-community-control select:focus-visible {
  outline: 3px solid #4cc9ff;
  outline-offset: 3px;
}

.bach-pau-community-badge {
  border-color: #72d7ff;
  background: #e9f8ff;
  color: #07509d;
}

@media (max-width: 760px) {
  .bach-pau-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .top-strip.mathup-header,
  .shell-compact .top-strip.mathup-header {
    height: 92px;
    padding: 8px 12px 12px;
    border-radius: 16px;
  }

  .mathup-header-layout {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 14px;
  }

  .mathup-crop-icon {
    width: 58px;
  }

  .mathup-crop-wordmark {
    width: min(100%, 300px);
  }

  .mathup-crop-tagline {
    display: none;
  }
}
