  :root {
    --academy-yellow: #ffd84f;
    --academy-blue: #63d5ff;
    --academy-green: #63e6a6;
    --academy-coral: #ff7f77;
    --academy-purple: #a88cff;
    --academy-ink: #263640;
    --academy-board: #dbe5dd;
    --academy-board-deep: #c7d5ca;
    --academy-board-line: #9fb4a5;
    --page-side: 28px;
    --footer-safe: 102px;
  }

  * {
    box-sizing: border-box;
  }

  html,
  body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, system-ui, sans-serif;
  }

  body.pk-academia {
    color: #fff;
    overflow: hidden;
    background:
      linear-gradient(
        rgba(34, 29, 106, 0.17),
        rgba(44, 25, 102, 0.25)
      ),
      url("../../img/academia/fondo-aula.png") center / cover fixed no-repeat;
  }

  /* =========================================================
    FONDO Y PLANETAS
    ========================================================= */

  .academy-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .academy-bg::before,
  .academy-bg::after {
    content: "";
    position: absolute;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: drop-shadow(0 24px 40px rgba(19, 18, 79, 0.28));
    will-change: transform;
  }

  .academy-bg::before {
    width: clamp(170px, 19vw, 310px);
    aspect-ratio: 1;
    left: -4vw;
    top: 12vh;
    background-image: url("../img/planet1.png");
    animation: academyPlanetLeft 9s ease-in-out infinite;
  }

  .academy-bg::after {
    width: clamp(150px, 17vw, 270px);
    aspect-ratio: 1;
    right: -3vw;
    bottom: 12vh;
    background-image: url("../img/planet2.png");
    animation: academyPlanetRight 11s ease-in-out infinite;
  }

  .orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.42;
    filter: blur(6px);
  }

  .orb-a {
    width: 310px;
    height: 310px;
    left: -130px;
    bottom: 2%;
    background: radial-gradient(
      circle,
      rgba(255, 216, 79, 0.9),
      rgba(255, 216, 79, 0)
    );
  }

  .orb-b {
    width: 390px;
    height: 390px;
    right: -160px;
    top: 3%;
    background: radial-gradient(
      circle,
      rgba(99, 230, 166, 0.72),
      rgba(99, 230, 166, 0)
    );
  }

  .spark {
    position: absolute;
    width: 11px;
    height: 11px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.95);
    animation: academyTwinkle 2.8s infinite alternate;
  }

  .spark-a {
    left: 18%;
    top: 19%;
  }

  .spark-b {
    right: 27%;
    top: 12%;
    animation-delay: -1s;
  }

  .spark-c {
    right: 13%;
    bottom: 22%;
    animation-delay: -2s;
  }

  @keyframes academyPlanetLeft {
    0%,
    100% {
      transform: translate3d(0, 0, 0) rotate(-4deg);
    }

    50% {
      transform: translate3d(15px, -17px, 0) rotate(4deg);
    }
  }

  @keyframes academyPlanetRight {
    0%,
    100% {
      transform: translate3d(0, 0, 0) rotate(5deg);
    }

    50% {
      transform: translate3d(-13px, 15px, 0) rotate(-4deg);
    }
  }

  @keyframes academyTwinkle {
    to {
      transform: scale(1.65) rotate(35deg);
      opacity: 0.25;
    }
  }

  /* =========================================================
    HEADER
    ========================================================= */

  .header {
    position: fixed;
    z-index: 30;
    top: 18px;
    left: var(--page-side);
    right: var(--page-side);
    height: 62px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.13);
    box-shadow: 0 18px 45px rgba(14, 20, 76, 0.22);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
  }

  .avatar {
    display: block;
    width: 44px;
    height: 44px;
    padding: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff, var(--academy-yellow));
  }

  .avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
  }

  .brand-title {
    font-size: 20px;
    font-weight: 900;
  }

  .header-actions {
    display: flex;
    gap: 10px;
  }

  .icon-btn {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    display: grid;
    place-items: center;
    text-decoration: none;
    font-size: 27px;
    font-weight: 900;
    cursor: pointer;
    transition:
      transform 0.2s ease,
      background 0.2s ease;
  }

  .icon-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.26);
  }

  /* =========================================================
    ESTRUCTURA PRINCIPAL
    ========================================================= */

  .academy-page {
    position: relative;
    z-index: 2;
    height: 100vh;
    padding: 92px var(--page-side) var(--footer-safe);
    display: grid;
    grid-template-columns: minmax(235px, 300px) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
  }

  .teacher-zone {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .teacher-badge {
    padding: 7px 13px;
    border-radius: 999px;
    background: var(--academy-yellow);
    color: #503a00;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
  }

  .character-holder {
    width: 100%;
    height: min(42vh, 350px);
    display: grid;
    place-items: center;
  }

  .character-holder img {
    width: min(330px, 25vw);
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 30px 36px rgba(0, 0, 0, 0.4));
    animation: teacherFloat 4s ease-in-out infinite;
  }

  @keyframes teacherFloat {
    50% {
      transform: translateY(-10px);
    }
  }

  .teacher-message {
    width: min(280px, 94%);
    margin-top: -12px;
    padding: 11px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--academy-ink);
    text-align: center;
    box-shadow: 0 16px 32px rgba(24, 25, 88, 0.22);
  }

  .teacher-message strong,
  .teacher-message span {
    display: block;
  }

  .teacher-message strong {
    font-size: 18px;
  }

  .teacher-message span {
    margin-top: 3px;
    font-size: 13px;
  }

  /* =========================================================
    BOTÓN DE VOZ
    ========================================================= */

  .talk-button {
    position: relative;
    min-width: 205px;
    min-height: 48px;
    margin-top: 10px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    overflow: hidden;
    background: linear-gradient(135deg, #fff3a1, var(--academy-yellow));
    color: #4b3900;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    box-shadow:
      0 14px 28px rgba(27, 20, 77, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition:
      transform 0.2s ease,
      filter 0.2s ease;
  }

  .talk-button:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.03);
  }

  .talk-button:disabled {
    opacity: 0.94;
    cursor: default;
  }

  .talk-dot {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
  }

  .talk-dot::before {
    content: "●";
    font-size: 14px;
    color: #ff6f61;
  }

  .talk-button.is-listening .talk-dot::before {
    content: "👂";
    font-size: 18px;
    line-height: 1;
  }

  .talk-button.is-thinking .talk-dot::before {
    content: "";
    width: 21px;
    height: 8px;
    background:
      radial-gradient(circle closest-side, #4b3b00 90%, transparent)
      0 50% / 7px 7px repeat-x;
    animation: academyDots 0.8s infinite linear;
  }

  .talk-button.is-speaking .talk-dot::before {
    content: "♪";
    font-size: 20px;
    color: #4b3b00;
    animation: speakingPulse 0.55s infinite alternate;
  }

  .talk-button.is-recovery .talk-dot::before {
    content: "↻";
    font-size: 20px;
    color: #4b3b00;
  }

  @keyframes academyDots {
    to {
      background-position: 21px 50%;
    }
  }

  @keyframes speakingPulse {
    to {
      transform: scale(1.25);
    }
  }

  /* =========================================================
    CONTENEDOR DE APRENDIZAJE
    ========================================================= */

  .learning-shell {
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 30px;
    display: grid;
    grid-template-rows: 34px minmax(0, 1fr) 92px;
    gap: 9px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: 0 30px 70px rgba(17, 17, 72, 0.3);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .learning-topbar {
    min-height: 34px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .back-lesson {
    padding: 7px 13px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
  }

  .lesson-path {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 900;
  }

  .progress-dots {
    margin-left: auto;
    display: flex;
    gap: 6px;
  }

  .progress-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
  }

  .progress-dots span.active {
    background: var(--academy-yellow);
    box-shadow: 0 0 12px var(--academy-yellow);
  }

  /* =========================================================
    PIZARRÓN VERDE GRISÁCEO
    ========================================================= */

  .board {
    position: relative;
    min-height: 0;
    padding: 17px 19px;
    border: 8px solid #b99368;
    border-radius: 25px;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(235px, 0.92fr) minmax(270px, 1.08fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 13px;
    color: var(--academy-ink);
  
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.45),
      inset 0 -18px 35px rgba(76, 101, 83, 0.08),
      0 18px 36px rgba(16, 20, 65, 0.2);
  }

  .board::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(85, 112, 91, 0.18);
    border-radius: 14px;
    pointer-events: none;
  }

  .board::after {
    content: "";
    position: absolute;
    left: 27px;
    right: 27px;
    bottom: 7px;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(
      90deg,
      var(--academy-blue),
      var(--academy-coral),
      var(--academy-green),
      var(--academy-purple)
    );
  }

  .board-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
    align-self: center;
  }

  .board-kicker {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    color: #496356;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.07em;
  }

  .board h1 {
    margin: 9px 0 7px;
    color: #314f42;
    font-size: clamp(26px, 3.2vw, 46px);
    line-height: 0.96;
    letter-spacing: -0.05em;
  }

  .board p {
    max-width: 500px;
    margin: 0;
    color: #52685c;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 750;
  }

  .board-visual {
    position: relative;
    z-index: 1;
    min-height: 0;
    padding: 10px;
    border: 2px dashed var(--academy-board-line);
    border-radius: 20px;
    align-self: stretch;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: rgba(248, 252, 248, 0.54);
  }

  .board-visual > svg {
    width: min(160px, 55%);
    height: min(160px, 70%);
    fill: none;
    stroke: #375849;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* =========================================================
    RESPUESTAS
    ========================================================= */

  .answer-panel {
    position: relative;
    z-index: 2;
    grid-column: 1 / -1;
    padding: 10px 12px 13px;
    border: 1px solid #dfc458;
    border-radius: 17px;
    background: #fff4b3;
  }

  .question {
    margin-bottom: 8px;
    color: #403100;
    font-size: 15px;
    font-weight: 900;
  }

  .answer-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .answer-actions input {
    min-height: 40px;
    padding: 0 13px;
    border: 2px solid #d5dfd8;
    border-radius: 13px;
    outline: none;
    color: #27324b;
    background: #fff;
    font: 800 14px Inter;
  }

  .answer-actions input:focus {
    border-color: #769682;
    box-shadow: 0 0 0 3px rgba(118, 150, 130, 0.16);
  }

  .answer-actions button {
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 13px;
    background: #385c4b;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
  }

  .answer-hint {
    min-height: 15px;
    margin-top: 6px;
    color: #675c31;
    font-size: 11px;
    font-weight: 800;
  }

  /* =========================================================
    TARJETAS
    ========================================================= */

  .choice-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
  }

  .choice-card {
    position: relative;
    min-width: 0;
    height: 92px;
    padding: 10px 11px;
    border: 0;
    border-radius: 19px;
    overflow: hidden;
    background: #fff;
    color: var(--academy-ink);
    text-align: left;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(28, 31, 95, 0.18);
    transition:
      transform 0.2s ease,
      box-shadow 0.2s ease;
  }

  .choice-card::after {
    content: "";
    position: absolute;
    width: 70px;
    height: 70px;
    right: -18px;
    top: -24px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--card-color) 25%, transparent);
  }

  .choice-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 17px 29px rgba(28, 31, 95, 0.23);
  }

  .choice-icon {
    width: 37px;
    height: 37px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--card-color) 18%, white);
    color: var(--card-color);
  }

  .choice-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .choice-label {
    display: block;
    margin-top: 6px;
    overflow: hidden;
    color: #263640;
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .choice-sub {
    display: block;
    margin-top: 1px;
    overflow: hidden;
    color: #748096;
    font-size: 10px;
    font-weight: 750;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* =========================================================
    VISUALES DE LAS CLASES
    ========================================================= */

  .mission-orbit {
    position: relative;
    width: min(240px, 75%);
    aspect-ratio: 1;
    border: 2px dashed #8fa799;
    border-radius: 50%;
    animation: orbitSpin 14s linear infinite;
  }

  .mission-orbit span {
    position: absolute;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: linear-gradient(145deg, #ffe36d, #ff9b75);
    box-shadow: 0 8px 18px rgba(52, 62, 120, 0.18);
  }

  .mission-orbit span:nth-child(1) {
    left: 10%;
    top: 15%;
  }

  .mission-orbit span:nth-child(2) {
    right: 5%;
    top: 35%;
    background: linear-gradient(145deg, #77ddff, #818cf8);
  }

  .mission-orbit span:nth-child(3) {
    left: 35%;
    bottom: 2%;
    background: linear-gradient(145deg, #7ce8ad, #48c68b);
  }

  .mission-orbit b {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #385c4b;
    font-size: 52px;
  }

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

  .subject-emblem {
    width: 130px;
    height: 130px;
    border-radius: 38px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--emblem) 18%, white);
    color: var(--emblem);
    box-shadow: 0 18px 35px rgba(35, 47, 105, 0.16);
  }

  .subject-emblem svg {
    width: 78px;
    height: 78px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .object-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .fruit {
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 46% 46%;
    background: linear-gradient(145deg, #ff6f61, #ffb24a);
    box-shadow:
      inset 0 0 0 4px rgba(255, 255, 255, 0.28),
      0 8px 14px rgba(44, 55, 105, 0.16);
    animation: tokenPop 0.45s both;
    animation-delay: var(--delay);
  }

  .fruit i {
    display: block;
    width: 9px;
    height: 6px;
    margin: 0 auto;
    border-radius: 100% 0;
    background: #49a96d;
  }

  .fruit.is-removed {
    opacity: 0.18;
    filter: grayscale(1);
    transform: translateY(18px) rotate(12deg);
  }

  .math-sign {
    color: #385c4b;
    font-size: 34px;
    font-weight: 900;
  }

  .group-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
  }

  .object-group {
    display: flex;
    gap: 6px;
    padding: 10px;
    border: 2px solid #a9bcae;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 18px rgba(45, 55, 120, 0.1);
  }

  .star-token {
    width: 28px;
    height: 28px;
    display: block;
    background: linear-gradient(145deg, #ffd955, #ff8b73);
    clip-path: polygon(
      50% 0,
      61% 35%,
      98% 35%,
      68% 57%,
      79% 94%,
      50% 72%,
      21% 94%,
      32% 57%,
      2% 35%,
      39% 35%
    );
    animation: tokenPop 0.45s both;
  }

  .helper-equation,
  .count-line {
    color: #52685c;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
  }

  .equation {
    padding: 7px 13px;
    border-radius: 13px;
    background: #385c4b;
    color: #fff;
    font-size: clamp(20px, 2.4vw, 32px);
    font-weight: 900;
  }

  .share-scene {
    width: 100%;
    display: grid;
    gap: 12px;
    place-items: center;
  }

  .candy-bank {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .candy {
    position: relative;
    width: 31px;
    height: 20px;
    border-radius: 7px;
    background: linear-gradient(135deg, #ff75a8, #8e7dff);
    animation: tokenPop 0.4s both;
  }

  .candy::before,
  .candy::after {
    content: "";
    position: absolute;
    top: 4px;
    border: 6px solid transparent;
  }

  .candy::before {
    left: -10px;
    border-right-color: #ff75a8;
  }

  .candy::after {
    right: -10px;
    border-left-color: #8e7dff;
  }

  .people-row {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
  }

  .person {
    min-width: 72px;
    padding: 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.62);
    text-align: center;
  }

  .person > b {
    display: block;
    color: #385c4b;
    font-size: 34px;
  }

  .person em {
    min-height: 18px;
    display: flex;
    justify-content: center;
    gap: 3px;
  }

  .mini-candy {
    width: 13px;
    height: 9px;
    border-radius: 3px;
    background: #ff75a8;
  }

  .success-burst {
    font-size: clamp(48px, 6vw, 80px);
    animation: successPop 1.2s ease-in-out infinite alternate;
  }

  .mission-complete {
    color: #385c4b;
    font-size: 22px;
    font-weight: 900;
  }

  @keyframes tokenPop {
    from {
      opacity: 0;
      transform: scale(0.3) translateY(14px);
    }

    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }

  @keyframes successPop {
    to {
      transform: scale(1.12) rotate(7deg);
    }
  }

  /* =========================================================
    MODAL DE ENTRADA
    ========================================================= */

  /* =========================================================
    MODAL DE ENTRADA — AULA
    ========================================================= */

  .academy-intro {
    position: fixed;
    z-index: 1000;
    inset: 0;

    padding: 24px;

    display: grid;
    place-items: center;

    overflow: hidden;

    background: #25384b;

    transition:
      opacity 0.4s ease,
      visibility 0.4s ease;
  }

  /* Imagen del aula desenfocada */

  .academy-intro {
    position: fixed;
    z-index: 1000;
    inset: 0;

    padding: 24px;

    display: grid;
    place-items: center;

    overflow: hidden;

    background:
      linear-gradient(
        rgba(15, 28, 43, 0.18),
        rgba(15, 28, 43, 0.3)
      ),
      url("../../img/academia/fondo-aula.png")
        center center / cover no-repeat;

    transition:
      opacity 0.4s ease,
      visibility 0.4s ease;
  }

  .academy-intro::before {
    content: "";

    position: absolute;
    inset: -24px;

    background:
      url("../../img/academia/fondo-aula.png")
        center center / cover no-repeat;

    filter:
      blur(6px)
      saturate(0.95)
      brightness(0.92);

    transform: scale(1.07);

    animation:
      academyClassroomZoom 14s
      ease-in-out infinite alternate;

    pointer-events: none;
  }
  /* Capa de profundidad */

  .academy-intro::after {
    content: "";

    position: absolute;
    inset: 0;

    background:
      radial-gradient(
        circle at 22% 48%,
        rgba(255, 221, 100, 0.24),
        transparent 34%
      ),
      linear-gradient(
        90deg,
        rgba(20, 36, 54, 0.22),
        rgba(255, 255, 255, 0.03) 50%,
        rgba(20, 36, 54, 0.2)
      );

    pointer-events: none;
  }

  @keyframes academyClassroomZoom {
    from {
      transform: scale(1.06);
    }

    to {
      transform: scale(1.1);
    }
  }

  .academy-intro[hidden] {
    display: none !important;
  }

  .academy-intro.is-closing {
    opacity: 0;
    visibility: hidden;
  }

  /* =========================================================
    TARJETA CENTRAL
    ========================================================= */

  .intro-card {
    position: relative;
    z-index: 2;

    width: min(1040px, 94vw);
    height: min(570px, 82vh);

    padding: 28px 38px;

    border: 1px solid
      rgba(255, 255, 255, 0.65);

    border-radius: 42px;
    top: 60px;

    display: grid;

    grid-template-areas:
      "character board"
      "character button";

    grid-template-columns:
      minmax(290px, 0.9fr)
      minmax(410px, 1.1fr);

    grid-template-rows:
      minmax(0, 1fr)
      auto;

    gap: 18px 34px;

    align-items: center;

    overflow: hidden;

    background:
      linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.22),
        rgba(255, 255, 255, 0.1)
      );

    box-shadow:
      0 38px 100px
        rgba(8, 17, 35, 0.48),
      inset 0 1px 0
        rgba(255, 255, 255, 0.5);

    backdrop-filter:
      blur(13px)
      saturate(1.08);

    -webkit-backdrop-filter:
      blur(13px)
      saturate(1.08);
  }

  /* Luz detrás del personaje */

  .intro-card::before {
    content: "";

    position: absolute;

    width: 440px;
    height: 440px;

    left: -85px;
    bottom: -170px;

    border-radius: 50%;

    background:
      radial-gradient(
        circle,
        rgba(255, 221, 91, 0.5),
        rgba(255, 196, 52, 0.12) 45%,
        transparent 70%
      );

    filter: blur(4px);

    pointer-events: none;
  }

  /* Línea de brillo superior */

  .intro-card::after {
    content: "";

    position: absolute;

    top: 0;
    left: 13%;
    right: 13%;

    height: 2px;

    background:
      linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.85),
        transparent
      );

    pointer-events: none;
  }

  /* =========================================================
    PERSONAJE PROFESOR
    ========================================================= */

  .intro-character {
    position: relative;
    z-index: 3;

    grid-area: character;

    width: 100%;
    height: 100%;

    min-height: 0;

    display: grid;
    place-items: end center;

    align-self: end;
  }

  .intro-character::before {
    content: "";

    position: absolute;

    left: 50%;
    bottom: 4%;

    width: 70%;
    height: 15%;

    border-radius: 50%;

    background:
      radial-gradient(
        ellipse,
        rgba(8, 17, 35, 0.38),
        transparent 70%
      );

    transform:
      translateX(-50%)
      scaleY(0.35);

    filter: blur(7px);
  }

  .intro-character img {
    position: relative;
    z-index: 2;

    display: block;

    width: auto;
    height: min(500px, 70vh);

    max-width: 100%;

    object-fit: contain;
    object-position: bottom center;

    filter:
      drop-shadow(
        0 28px 30px
        rgba(5, 15, 30, 0.42)
      );

    transform-origin: bottom center;

    animation:
      introTeacherEntrance 0.85s
        cubic-bezier(
          0.2,
          0.85,
          0.3,
          1.15
        )
        both,
      introTeacherFloat 4.2s
        ease-in-out
        0.9s
        infinite;
  }

  @keyframes introTeacherEntrance {
    from {
      opacity: 0;
      transform:
        translateY(40px)
        scale(0.9);
    }

    to {
      opacity: 1;
      transform:
        translateY(0)
        scale(1);
    }
  }

  @keyframes introTeacherFloat {
    0%,
    100% {
      transform:
        translateY(0)
        rotate(-0.5deg);
    }

    50% {
      transform:
        translateY(-9px)
        rotate(0.6deg);
    }
  }

  /* =========================================================
    CARTEL DE BIENVENIDA
    ========================================================= */

  .intro-board {
    position: relative;
    z-index: 3;

    grid-area: board;

    width: 100%;

    align-self: end;

    padding: 30px 34px;

    border:
      1px solid
      rgba(255, 255, 255, 0.72);

    border-radius: 29px;

    color: #263640;

    background:
      linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.95),
        rgba(240, 247, 242, 0.87)
      );

    box-shadow:
      0 24px 55px
        rgba(13, 25, 43, 0.28),
      inset 0 1px 0
        rgba(255, 255, 255, 0.95);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .intro-board::before {
    content: "";

    position: absolute;

    left: 32px;
    right: 32px;
    bottom: 14px;

    height: 4px;

    border-radius: 999px;

    background:
      linear-gradient(
        90deg,
        #63d5ff,
        #ff7f77,
        #63e6a6,
        #a88cff
      );
  }

  .intro-kicker {
    display: inline-flex;

    padding: 7px 12px;

    border-radius: 999px;

    background: #ffe36b;

    color: #4c3a00;

    font-size: 11px;
    font-weight: 900;

    letter-spacing: 0.08em;

    box-shadow:
      0 8px 18px
        rgba(255, 200, 30, 0.2);
  }

  .intro-board h1 {
    margin: 16px 0 8px;

    color: #294d40;

    font-size:
      clamp(41px, 5vw, 67px);

    line-height: 0.93;

    letter-spacing: -0.055em;
  }

  .intro-board p {
    margin: 0;

    color: #354f43;

    font-size: 23px;
    font-weight: 900;
  }

  .intro-board small {
    display: block;

    max-width: 470px;

    margin-top: 14px;
    padding-bottom: 7px;

    color: #5d7166;

    font-size: 14px;
    line-height: 1.45;
    font-weight: 750;
  }

  /* =========================================================
    BOTÓN DE INGRESO
    ========================================================= */

  .start-academy {
    position: relative;
    z-index: 3;

    grid-area: button;

    justify-self: start;

    min-height: 64px;

    margin: 0 0 5px;

    padding:
      0 13px
      0 29px;

    border: 1px solid
      rgba(255, 255, 255, 0.74);

    border-radius: 999px;

    display: flex;
    align-items: center;

    gap: 20px;

    background:
      linear-gradient(
        135deg,
        #fff5a8,
        #ffd52e
      );

    color: #493600;

    font-size: 17px;
    font-weight: 900;

    cursor: pointer;

    box-shadow:
      0 20px 42px
        rgba(11, 20, 42, 0.32),
      inset 0 1px 0
        rgba(255, 255, 255, 0.84);

    transition:
      transform 0.2s ease,
      filter 0.2s ease,
      box-shadow 0.2s ease;
  }

  .start-academy:hover {
    transform: translateY(-3px);

    filter: brightness(1.04);

    box-shadow:
      0 26px 50px
        rgba(11, 20, 42, 0.38),
      inset 0 1px 0
        rgba(255, 255, 255, 0.9);
  }

  .start-academy b {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    border-radius: 50%;

    display: grid;
    place-items: center;

    background: #385c4b;

    color: #fff;

    font-size: 25px;
  }

  /* =========================================================
    ESTRELLAS DECORATIVAS
    ========================================================= */

  .intro-stars span {
    position: absolute;
    z-index: 4;

    color: #fff;

    font-size: 30px;

    text-shadow:
      0 0 18px
        rgba(255, 255, 255, 0.85);

    animation:
      academyTwinkle 2s
      infinite alternate;
  }

  .intro-stars span:nth-child(1) {
    left: 4%;
    top: 7%;
  }

  .intro-stars span:nth-child(2) {
    right: 5%;
    top: 7%;

    animation-delay: -0.7s;
  }

  .intro-stars span:nth-child(3) {
    right: 3%;
    bottom: 14%;

    animation-delay: -1.3s;
  }

  /* =========================================================
    MODAL RESPONSIVE
    ========================================================= */

  @media (max-height: 760px)
  and (min-width: 901px) {

    .intro-card {
      height: min(510px, 86vh);
    }

    .intro-character img {
      height: min(445px, 70vh);
    }

    .intro-board {
      padding: 24px 27px;
    }

    .intro-board h1 {
      font-size: 47px;
    }

    .intro-board p {
      font-size: 20px;
    }
  }

  @media (max-width: 900px) {

    .academy-intro {
      padding: 14px;
    }

    .intro-card {
      width: min(590px, 96vw);
      height: min(760px, 94vh);

      padding: 20px;

      grid-template-areas:
        "character"
        "board"
        "button";

      grid-template-columns: 1fr;

      grid-template-rows:
        minmax(210px, 1fr)
        auto
        auto;

      gap: 10px;

      overflow-y: auto;

      border-radius: 32px;
    }

    .intro-character {
      height: 280px;
    }

    .intro-character img {
      height: 285px;
    }

    .intro-board {
      padding: 21px;

      border-radius: 23px;
    }

    .intro-board h1 {
      margin-top: 11px;

      font-size: 39px;
    }

    .intro-board p {
      font-size: 19px;
    }

    .intro-board small {
      font-size: 12px;
    }

    .start-academy {
      justify-self: center;

      min-height: 57px;

      font-size: 15px;
    }
  }

  @media (max-width: 540px) {

    .academy-intro {
      padding: 8px;
    }

    .intro-card {
      width: 98vw;
      height: 96vh;

      padding: 13px;

      border-radius: 25px;

      grid-template-rows:
        minmax(185px, 0.9fr)
        auto
        auto;
    }

    .intro-character {
      height: 215px;
    }

    .intro-character img {
      height: 225px;
    }

    .intro-board {
      padding: 17px;
    }

    .intro-board h1 {
      font-size: 33px;
    }

    .intro-board p {
      font-size: 17px;
    }

    .start-academy {
      width: 100%;

      padding-left: 20px;

      justify-content:
        space-between;
    }
  }

  /* El footer usa los estilos globales del index.
    No se redefine .footer ni .tab en esta página. */

  audio {
    display: none !important;
  }

  /* =========================================================
    ESCRITORIO COMPACTO
    ========================================================= */

  @media (min-width: 901px) {
    .academy-page {
      padding-top: 82px;
      padding-bottom: 92px;
      grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
      gap: 16px;
    }

    .learning-shell {
      height: calc(100vh - 180px);
      padding: 12px;
      grid-template-rows: 30px minmax(0, 1fr) 82px;
    }

    .character-holder {
      height: min(38vh, 310px);
    }

    .teacher-message {
      padding: 9px 13px;
    }

    .teacher-message strong {
      font-size: 20px;
    }

    .teacher-message span {
      font-size: 12px;
    }

    .board {
      padding: 13px 16px;
      gap: 10px;
    }

    .board h1 {
      font-size: clamp(24px, 2.7vw, 40px);
    }

    .board p {
      font-size: 13px;
    }

    .board-visual {
      padding: 8px;
    }

    .choice-card {
      height: 80px;
      padding: 8px 10px;
    }

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

    .choice-icon svg {
      width: 21px;
      height: 21px;
    }

    .choice-label {
      font-size: 13px;
    }
  }

  /* =========================================================
    PANTALLAS BAJAS
    ========================================================= */

  @media (max-height: 760px) and (min-width: 901px) {
    :root {
      --footer-safe: 90px;
    }

    .header {
      top: 10px;
      height: 56px;
    }

    .academy-page {
      padding-top: 76px;
    }

    .character-holder {
      height: min(38vh, 285px);
    }

    .teacher-message {
      padding: 9px 13px;
    }

    .learning-shell {
      grid-template-rows: 30px minmax(0, 1fr) 82px;
    }

    .choice-card {
      height: 82px;
    }

    .board {
      padding: 13px 15px;
    }

    .board h1 {
      font-size: clamp(24px, 3vw, 40px);
    }

    .intro-card {
      height: min(470px, 82vh);
      padding: 22px 28px;
    }

    .intro-board {
      padding: 22px 26px;
    }

    .intro-board h1 {
      font-size: 44px;
    }

    .intro-board p {
      font-size: 20px;
    }
  }

  @media (max-height: 720px) and (min-width: 901px) {
    .header {
      top: 8px;
      height: 52px;
    }

    .academy-page {
      padding-top: 68px;
      padding-bottom: 80px;
    }

    .learning-shell {
      height: calc(100vh - 148px);
      grid-template-rows: 26px minmax(0, 1fr) 72px;
    }

    .character-holder {
      height: min(34vh, 250px);
    }

    .teacher-badge {
      font-size: 9px;
    }

    .talk-button {
      min-height: 44px;
    }

    .choice-card {
      height: 70px;
    }

    .choice-sub {
      display: none;
    }
  }

  /* =========================================================
    TABLET Y MÓVIL
    ========================================================= */

  @media (max-width: 900px) {
    body.pk-academia {
      overflow: auto;
      background-attachment: scroll;
    }

    .academy-bg::before {
      width: 170px;
      left: -65px;
      top: 170px;
    }

    .academy-bg::after {
      width: 145px;
      right: -50px;
      bottom: 140px;
    }

    .header {
      left: 12px;
      right: 12px;
      top: 10px;
      height: 56px;
    }

    .academy-page {
      height: auto;
      min-height: 100vh;
      padding: 80px 12px 105px;
      grid-template-columns: 1fr;
      gap: 12px;
    }

    .teacher-zone {
      min-height: auto;
    }

    .teacher-badge {
      display: none;
    }

    .character-holder {
      height: 220px;
    }

    .character-holder img {
      width: min(270px, 70vw);
    }

    .teacher-message {
      margin-top: -18px;
    }

    .learning-shell {
      height: auto;
      grid-template-rows: auto auto auto;
    }

    .board {
      grid-template-columns: 1fr;
      grid-template-rows: auto minmax(190px, auto) auto;
    }

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

    .intro-card {
      width: min(560px, 94vw);
      height: min(650px, 88vh);
      padding: 22px;
      grid-template-areas:
        "character"
        "board"
        "button";
      grid-template-columns: 1fr;
      grid-template-rows: minmax(150px, 1fr) auto auto;
      overflow: auto;
    }

    .intro-character {
      height: 230px;
    }

    .intro-board {
      padding: 22px;
      border-width: 6px;
    }

    .intro-board h1 {
      font-size: 40px;
    }

    .start-academy {
      justify-self: center;
      min-height: 56px;
      font-size: 15px;
    }
  }

  @media (max-width: 540px) {
    :root {
      --page-side: 10px;
    }

    .brand-title {
      font-size: 17px;
    }

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

    .header-actions {
      gap: 6px;
    }

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

    .character-holder {
      height: 195px;
    }

    .learning-shell {
      padding: 8px;
      border-radius: 24px;
    }

    .board {
      padding: 15px;
      border-width: 6px;
      border-radius: 21px;
    }

    .board h1 {
      font-size: 30px;
    }

    .board p {
      font-size: 13px;
    }

    .choice-grid {
      gap: 8px;
    }

    .choice-card {
      height: 88px;
    }

    .answer-actions {
      grid-template-columns: 1fr;
    }

    .answer-actions button {
      width: 100%;
    }

    .intro-card {
      padding: 16px;
      border-radius: 30px;
    }

    .intro-character {
      height: 195px;
    }

    .intro-board {
      padding: 18px;
    }

    .intro-board h1 {
      font-size: 34px;
    }

    .intro-board p {
      font-size: 19px;
    }

    .intro-board small {
      font-size: 12px;
    }

    .start-academy {
      width: 100%;
      padding-left: 20px;
      padding-right: 12px;
      justify-content: space-between;
    }
  }

  /* =========================================================
    FOOTER — MISMO ESTILO VISUAL DEL INDEX
    ========================================================= */

  .footer {
    position: fixed;
    z-index: 50;
    left: var(--page-side);
    right: var(--page-side);
    bottom: 18px;

    height: 82px;
    padding: 8px 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 999px;


    box-shadow:
      0 18px 50px rgba(8, 12, 63, 0.42),
      inset 0 1px 0 rgba(255, 255, 255, 0.25);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .footer .tab {
    position: relative;

    min-width: 72px;
    height: 66px;
    padding: 5px 12px;

    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 24px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;

    color: #fff;
    text-decoration: none;

    background: rgba(255, 255, 255, 0.15);

    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.24),
      0 8px 18px rgba(13, 18, 78, 0.18);

    transition:
      transform 0.2s ease,
      background 0.2s ease,
      box-shadow 0.2s ease;
  }

  .footer .tab:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.23);
  }

  .footer .tab.active {
    background:
      linear-gradient(
        145deg,
        #ffe76a,
        #ffc91f
      );

    border-color: rgba(255, 255, 255, 0.72);

    color: #4c3a00;

    box-shadow:
      0 10px 25px rgba(255, 200, 30, 0.32),
      inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  .footer .tab-icon {
    width: 35px;
    height: 35px;

    border-radius: 50%;

    display: grid;
    place-items: center;

    background: rgba(255, 255, 255, 0.72);

    font-size: 20px;
    line-height: 1;

    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.74),
      0 5px 12px rgba(30, 35, 100, 0.18);
  }

  .footer .tab.active .tab-icon {
    background: rgba(255, 255, 255, 0.9);
  }

  .footer .tab-label {
    display: block;

    font-size: 10px;
    line-height: 1;
    font-weight: 900;

    white-space: nowrap;

    text-shadow: 0 2px 5px rgba(12, 15, 64, 0.28);
  }

  .footer .tab.active .tab-label {
    color: #4c3a00;
    text-shadow: none;
  }

  /* Espacio reservado para que Academia no quede detrás del footer */

  .academy-page {
    padding-bottom: 112px;
  }

  /* =========================================================
    FOOTER RESPONSIVE
    ========================================================= */

  @media (max-height: 760px) and (min-width: 901px) {
    .footer {
      bottom: 10px;
      height: 72px;
      padding: 6px 18px;
    }

    .footer .tab {
      height: 58px;
    }

    .footer .tab-icon {
      width: 31px;
      height: 31px;
      font-size: 17px;
    }

    .academy-page {
      padding-bottom: 92px;
    }
  }

  @media (max-width: 900px) {
    .footer {
      left: 10px;
      right: 10px;
      bottom: 9px;

      height: 73px;
      padding: 6px 10px;
      gap: 5px;
    }

    .footer .tab {
      min-width: 58px;
      height: 59px;
      padding: 4px 7px;
      border-radius: 20px;
    }

    .footer .tab-icon {
      width: 31px;
      height: 31px;
      font-size: 17px;
    }

    .footer .tab-label {
      font-size: 9px;
    }

    .academy-page {
      padding-bottom: 98px;
    }
  }

  @media (max-width: 540px) {
    .footer {
      overflow-x: auto;
      justify-content: flex-start;
      scrollbar-width: none;
    }

    .footer::-webkit-scrollbar {
      display: none;
    }

    .footer .tab {
      flex: 0 0 61px;
    }
  }

  /* =========================================================
    PANTALLA PRINCIPAL DE ACADEMIA
    ========================================================= */

 body.pk-academia {
  position: relative;
  isolation: isolate;

  background: #1f3b48;

  overflow: hidden;
}

  /* Fondo del aula */

  body.pk-academia::before {
  content: "";

  position: fixed;
  z-index: 0;

  inset: -20px;

  background:
    linear-gradient(
      rgba(18, 39, 55, 0.08),
      rgba(22, 36, 56, 0.17)
    ),
    url("../../img/academia/fondo-aula.png")
      center center / cover no-repeat;

  filter:
    saturate(1.05)
    brightness(0.92);

  transform: scale(1.03);

  pointer-events: none;
}

  /* Capa para integrar el aula con Planet Kids */

  body.pk-academia::after {
    content: "";

    position: fixed;
  z-index: 1;
    inset: 0;

    background:
      radial-gradient(
        circle at 11% 42%,
        rgba(255, 205, 73, 0.23),
        transparent 28%
      ),
      radial-gradient(
        circle at 88% 32%,
        rgba(81, 201, 255, 0.18),
        transparent 30%
      ),
      linear-gradient(
        90deg,
        rgba(20, 32, 72, 0.27),
        rgba(20, 32, 72, 0.02) 42%,
        rgba(20, 32, 72, 0.16)
      );

    pointer-events: none;
  }

  /* No necesitamos planetas adicionales sobre el aula */

  .academy-bg {
    opacity: 0.32;
  }

  .academy-bg::before,
  .academy-bg::after {
    display: none;
  }

  /* =========================================================
    DISTRIBUCIÓN GENERAL
    ========================================================= */

  .academy-page {
    padding-top: 92px;
    padding-bottom: 114px;

    grid-template-columns:
      minmax(225px, 285px)
      minmax(0, 1fr);

    gap: 22px;
  }

  /* =========================================================
    PERSONAJE Y SALUDO
    ========================================================= */

  .teacher-zone {
    position: relative;

    padding: 15px 10px 8px;

    border: 1px solid
      rgba(255, 255, 255, 0.38);

    border-radius: 42px;

    background:
      linear-gradient(
        145deg,
        rgba(24, 47, 65, 0.34),
        rgba(255, 255, 255, 0.1)
      );

    box-shadow:
      0 25px 60px
        rgba(11, 22, 43, 0.3),
      inset 0 1px 0
        rgba(255, 255, 255, 0.35);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .teacher-badge {
    position: absolute;

    top: 18px;
    left: 50%;

    transform: translateX(-50%);

    z-index: 3;
  }

  .character-holder {
    height: min(43vh, 350px);

    margin-top: 28px;
  }

  .character-holder img {
    width: min(310px, 23vw);
  }

  .teacher-message {
    width: min(260px, 92%);

    margin-top: -18px;

    border: 1px solid
      rgba(255, 255, 255, 0.7);

    background:
      rgba(255, 255, 255, 0.92);
  }

  .talk-button {
    margin-bottom: 8px;
  }

  /* =========================================================
    CONTENEDOR DE MATERIAS
    ========================================================= */

  .learning-shell {
    height: 100%;

    padding: 18px 22px 21px;

    border: 1px solid
      rgba(255, 255, 255, 0.48);

    border-radius: 43px;

    grid-template-rows:
      32px
      auto
      minmax(0, 1fr);

    gap: 10px;

    background:
      linear-gradient(
        145deg,
        rgba(26, 50, 67, 0.28),
        rgba(255, 255, 255, 0.11)
      );

    box-shadow:
      0 30px 75px
        rgba(9, 20, 42, 0.35),
      inset 0 1px 0
        rgba(255, 255, 255, 0.35);

    backdrop-filter:
      blur(9px)
      saturate(1.05);

    -webkit-backdrop-filter:
      blur(9px)
      saturate(1.05);
  }

  /* =========================================================
    TÍTULO PRINCIPAL SIN PIZARRÓN
    ========================================================= */

  .learning-shell:not(.lesson-mode) .board {
    min-height: auto;

    padding: 10px 10px 15px;

    border: 0;
    border-radius: 0;

    display: block;

    overflow: visible;

    color: #fff;

    background: none;

    box-shadow: none;
  }

  .learning-shell:not(.lesson-mode) .board::before,
  .learning-shell:not(.lesson-mode) .board::after {
    display: none;
  }

  .learning-shell:not(.lesson-mode) .board-copy {
    width: 100%;

    text-align: center;
  }

  .learning-shell:not(.lesson-mode) .board-kicker {
    padding: 7px 13px;

    background:
      linear-gradient(
        135deg,
        #fff1a2,
        #ffd239
      );

    color: #4d3b00;

    box-shadow:
      0 10px 24px
        rgba(13, 22, 40, 0.19);
  }

  .learning-shell:not(.lesson-mode) .board h1 {
    max-width: 700px;

    margin:
      12px auto 7px;

    color: #fff;

    font-size:
      clamp(36px, 4vw, 61px);

    line-height: 0.95;

    text-shadow:
      0 6px 22px
        rgba(10, 19, 39, 0.33);
  }

  .learning-shell:not(.lesson-mode) .board p {
    max-width: 690px;

    margin: 0 auto;

    color:
      rgba(255, 255, 255, 0.86);

    font-size: 14px;

    text-shadow:
      0 3px 12px
        rgba(10, 19, 39, 0.33);
  }

  /* Sin dibujo ni pizarrón en la portada */

  .learning-shell:not(.lesson-mode)
  .board-visual {
    display: none;
  }

  .learning-shell:not(.lesson-mode)
  .answer-panel {
    display: none !important;
  }

  /* =========================================================
    PORTALES CIRCULARES DE MATERIAS
    ========================================================= */

  .choice-grid {
    width: 100%;
    min-height: 0;

    display: grid;

    grid-template-columns:
      repeat(4, minmax(0, 1fr));

    align-items: center;

    gap: clamp(12px, 1.5vw, 22px);

    padding: 4px 7px 8px;
  }

  .choice-card.subject-portal {
    --portal-size:
      clamp(155px, 15.5vw, 225px);

    position: relative;

    width: min(
      100%,
      var(--portal-size)
    );

    height: auto;
    aspect-ratio: 1;

    justify-self: center;

    padding: 0;

    border:
      4px solid
      rgba(255, 255, 255, 0.7);

    border-radius: 50%;

    overflow: hidden;

    isolation: isolate;

    color: #fff;

    background:
      radial-gradient(
        circle at 35% 26%,
        color-mix(
          in srgb,
          var(--card-color) 75%,
          white
        ),
        var(--card-color) 52%,
        color-mix(
          in srgb,
          var(--card-color) 55%,
          #15194a
        )
      );

    box-shadow:
      0 24px 40px
        rgba(8, 18, 39, 0.32),
      inset 0 0 0 2px
        rgba(255, 255, 255, 0.18),
      inset 0 -34px 55px
        rgba(15, 18, 55, 0.28);

    transform:
      translateY(
        var(--portal-offset, 0)
      );

    animation:
      portalFloating
      4.8s
      ease-in-out
      infinite;

    transition:
      transform 0.3s
        cubic-bezier(
          0.2,
          0.8,
          0.25,
          1.15
        ),
      box-shadow 0.3s ease,
      filter 0.3s ease;
  }

  /* Los círculos no quedan todos perfectamente alineados */

  .choice-card.subject-portal:nth-child(1) {
    --portal-offset: -5px;
  }

  .choice-card.subject-portal:nth-child(2) {
    --portal-offset: 9px;

    animation-delay: -1.1s;
  }

  .choice-card.subject-portal:nth-child(3) {
    --portal-offset: -2px;

    animation-delay: -2.2s;
  }

  .choice-card.subject-portal:nth-child(4) {
    --portal-offset: 12px;

    animation-delay: -3.2s;
  }

  .choice-card.subject-portal::after {
    display: none;
  }

  .choice-card.subject-portal:hover {
    transform:
      translateY(
        calc(
          var(--portal-offset, 0px)
          - 9px
        )
      )
      scale(1.055);

    filter:
      saturate(1.14)
      brightness(1.05);

    box-shadow:
      0 34px 55px
        rgba(8, 18, 39, 0.4),
      0 0 0 6px
        color-mix(
          in srgb,
          var(--card-color) 34%,
          transparent
        ),
      inset 0 0 0 2px
        rgba(255, 255, 255, 0.28);
  }

  @keyframes portalFloating {
    0%,
    100% {
      margin-top: 0;
    }

    50% {
      margin-top: -8px;
    }
  }

  /* =========================================================
    AROS
    ========================================================= */

  .portal-ring {
    position: absolute;

    border-radius: 50%;

    pointer-events: none;
  }

  .portal-ring--outer {
    z-index: -1;

    inset: 8%;

    border:
      1px solid
      rgba(255, 255, 255, 0.42);

    animation:
      portalRingRotate
      14s
      linear
      infinite;
  }

  .portal-ring--outer::before,
  .portal-ring--outer::after {
    content: "";

    position: absolute;

    width: 11px;
    height: 11px;

    border-radius: 50%;

    background: #fff;

    box-shadow:
      0 0 14px
        rgba(255, 255, 255, 0.9);
  }

  .portal-ring--outer::before {
    left: 13%;
    top: 10%;
  }

  .portal-ring--outer::after {
    right: 6%;
    bottom: 22%;
  }

  .portal-ring--inner {
    z-index: -1;

    inset: 23%;

    border:
      1px dashed
      rgba(255, 255, 255, 0.33);

    animation:
      portalRingRotateReverse
      10s
      linear
      infinite;
  }

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

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

  /* =========================================================
    BRILLO INTERIOR
    ========================================================= */

  .portal-glow {
    position: absolute;
    z-index: -2;

    width: 70%;
    height: 70%;

    left: -20%;
    top: -25%;

    border-radius: 50%;

    background:
      radial-gradient(
        circle,
        rgba(255, 255, 255, 0.65),
        transparent 69%
      );

    filter: blur(5px);
  }

  /* =========================================================
    SÍMBOLOS FLOTANTES
    ========================================================= */

  .portal-symbols {
    position: absolute;
    z-index: 1;

    inset: 0;

    pointer-events: none;
  }

  .portal-symbol {
    position: absolute;

    width: 36px;
    height: 36px;

    border:
      1px solid
      rgba(255, 255, 255, 0.44);

    border-radius: 13px;

    display: grid;
    place-items: center;

    color: #fff;

    background:
      rgba(255, 255, 255, 0.17);

    box-shadow:
      0 8px 17px
        rgba(15, 18, 52, 0.19),
      inset 0 1px 0
        rgba(255, 255, 255, 0.35);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    font-style: normal;
    font-size: 19px;
    font-weight: 900;

    text-shadow:
      0 2px 5px
        rgba(15, 18, 52, 0.28);

    animation:
      portalSymbolFloat
      3.7s
      ease-in-out
      infinite;
  }

  .portal-symbol--a {
    left: 13%;
    top: 17%;
  }

  .portal-symbol--b {
    right: 13%;
    top: 13%;

    animation-delay: -0.8s;
  }

  .portal-symbol--c {
    left: 11%;
    top: 48%;

    animation-delay: -1.6s;
  }

  .portal-symbol--d {
    right: 10%;
    top: 46%;

    animation-delay: -2.3s;
  }

  @keyframes portalSymbolFloat {
    0%,
    100% {
      transform:
        translateY(0)
        rotate(-3deg);
    }

    50% {
      transform:
        translateY(-7px)
        rotate(4deg);
    }
  }

  /* =========================================================
    ICONO CENTRAL
    ========================================================= */

  .choice-card.subject-portal
  .choice-icon {
    position: absolute;
    z-index: 3;

    left: 50%;
    top: 39%;

    width: 66px;
    height: 66px;

    margin: 0;

    border:
      2px solid
      rgba(255, 255, 255, 0.78);

    border-radius: 23px;

    display: grid;
    place-items: center;

    color: #fff;

    background:
      rgba(255, 255, 255, 0.2);

    box-shadow:
      0 14px 27px
        rgba(14, 20, 62, 0.24),
      inset 0 1px 0
        rgba(255, 255, 255, 0.48);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);

    transform:
      translate(-50%, -50%);
  }

  .choice-card.subject-portal
  .choice-icon svg {
    width: 40px;
    height: 40px;

    stroke-width: 2.7;
  }

  /* =========================================================
    TEXTO EN LA PARTE INFERIOR
    ========================================================= */

  .portal-bottom {
    position: absolute;
    z-index: 2;

    left: 0;
    right: 0;
    bottom: 0;

    height: 44%;

    background:
      linear-gradient(
        transparent,
        rgba(13, 18, 53, 0.84)
      );

    pointer-events: none;
  }

  .portal-copy {
    position: absolute;
    z-index: 4;

    left: 9%;
    right: 9%;
    bottom: 9%;

    display: block;

    text-align: center;

    pointer-events: none;
  }

  .choice-card.subject-portal
  .choice-label {
    display: block;

    margin: 0;

    overflow: visible;

    color: #fff;

    font-size:
      clamp(15px, 1.4vw, 22px);

    line-height: 1;
    font-weight: 900;

    white-space: normal;

    text-shadow:
      0 3px 9px
        rgba(8, 14, 42, 0.8);
  }

  .choice-card.subject-portal
  .choice-sub {
    display: block;

    margin-top: 5px;

    overflow: visible;

    color:
      rgba(255, 255, 255, 0.8);

    font-size:
      clamp(8px, 0.73vw, 11px);

    line-height: 1.1;

    white-space: normal;

    text-shadow:
      0 2px 6px
        rgba(8, 14, 42, 0.8);
  }

  /* =========================================================
    CUANDO SE ABRE UNA LECCIÓN
    Conservamos temporalmente el diseño anterior.
    En la próxima etapa irá dentro de un modal.
    ========================================================= */

  .learning-shell.lesson-mode {
    grid-template-rows:
      34px
      minmax(0, 1fr)
      0;
  }

  .learning-shell.lesson-mode
  .choice-grid {
    display: none;
  }

  /* =========================================================
    RESPONSIVE
    ========================================================= */

  @media (max-width: 1180px)
  and (min-width: 901px) {

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

      gap: 14px 25px;
    }

    .choice-card.subject-portal {
      --portal-size:
        clamp(145px, 17vh, 190px);
    }

    .learning-shell:not(.lesson-mode)
    .board h1 {
      font-size: 42px;
    }
  }

  @media (max-width: 900px) {

    body.pk-academia {
      overflow-y: auto;
    }

    .academy-page {
      padding-bottom: 103px;

      grid-template-columns: 1fr;
    }

    .teacher-zone {
      min-height: 315px;
    }

    .learning-shell {
      min-height: 680px;
    }

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

      gap: 18px;
    }

    .choice-card.subject-portal {
      --portal-size:
        min(39vw, 205px);
    }
  }

  @media (max-width: 540px) {

    .learning-shell {
      min-height: 610px;

      padding:
        14px 10px 18px;
    }

    .learning-shell:not(.lesson-mode)
    .board h1 {
      font-size: 34px;
    }

    .choice-grid {
      gap: 11px;

      padding-left: 0;
      padding-right: 0;
    }

    .choice-card.subject-portal {
      --portal-size:
        min(43vw, 180px);

      border-width: 3px;
    }

    .portal-symbol {
      width: 29px;
      height: 29px;

      border-radius: 10px;

      font-size: 15px;
    }

    .choice-card.subject-portal
    .choice-icon {
      width: 54px;
      height: 54px;

      border-radius: 18px;
    }

    .choice-card.subject-portal
    .choice-icon svg {
      width: 32px;
      height: 32px;
    }

    .choice-card.subject-portal
    .choice-label {
      font-size: 14px;
    }

    .choice-card.subject-portal
    .choice-sub {
      display: none;
    }
  }

  /* =========================================================
   MODAL DEFINITIVO DE CLASE
   ========================================================= */

body.lesson-modal-open {
  overflow: hidden !important;
}

/* Ocultos mientras estamos eligiendo materias */

.lesson-teacher-panel,
.close-lesson-modal,
.lesson-modal-backdrop {
  display: none;
}

/* =========================================================
   OVERLAY GENERAL
   ========================================================= */

.learning-shell.lesson-mode {
  position: fixed;
  z-index: 500;

  inset: 18px 26px;

  width: auto;
  height: auto;

  padding: 0;

  border: 1px solid
    rgba(255, 255, 255, 0.7);

  border-radius: 34px;

  display: grid;

  grid-template-columns:
    minmax(230px, 285px)
    minmax(0, 1fr);

  grid-template-rows:
    66px
    minmax(0, 1fr);

  grid-template-areas:
    "teacher topbar"
    "teacher board";

  gap: 0;

  overflow: hidden;

  background:
    rgba(246, 249, 247, 0.97);

  box-shadow:
    0 40px 110px
      rgba(8, 18, 35, 0.55);

  backdrop-filter: none;
  -webkit-backdrop-filter: none;

  opacity: 0;

  transform:
    translateY(25px)
    scale(0.97);

  transition:
    opacity 0.28s ease,
    transform 0.32s
      cubic-bezier(
        0.2,
        0.8,
        0.2,
        1
      );
}

.learning-shell.lesson-mode
.lesson-modal-backdrop {
  position: fixed;
  z-index: -1;

  inset: -40px;

  display: block;

  background:
    linear-gradient(
      rgba(16, 34, 48, 0.35),
      rgba(12, 26, 40, 0.48)
    ),
    url("../../img/academia/fondo-aula.png")
      center / cover no-repeat;

  filter:
    blur(7px)
    brightness(0.74);

  transform: scale(1.06);

  pointer-events: none;
}

.learning-shell.lesson-mode
.lesson-modal-backdrop::after {
  content: "";

  position: absolute;
  inset: 0;

  background:
    radial-gradient(
      circle at 17% 42%,
      rgba(255, 216, 79, 0.24),
      transparent 28%
    ),
    linear-gradient(
      90deg,
      rgba(28, 48, 70, 0.16),
      transparent 48%,
      rgba(28, 48, 70, 0.13)
    );
}

.learning-shell.lesson-mode.lesson-modal-visible {
  opacity: 1;

  transform:
    translateY(0)
    scale(1);
}

/* =========================================================
   PROFESOR
   ========================================================= */

.learning-shell.lesson-mode
.lesson-teacher-panel {
  position: relative;
  z-index: 3;

  grid-area: teacher;

  min-width: 0;

  padding:
    22px 18px
    20px;

  display: flex;
  flex-direction: column;
  align-items: center;

  overflow: hidden;

  background:
    linear-gradient(
      180deg,
      #eff7f2,
      #e3eee7
    );

  border-right:
    1px solid #d6e2da;
}

.lesson-teacher-panel::before {
  content: "";

  position: absolute;

  width: 300px;
  height: 300px;

  left: -105px;
  bottom: -120px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(255, 216, 79, 0.52),
      transparent 68%
    );
}

.lesson-teacher-badge {
  position: relative;
  z-index: 2;

  padding: 7px 12px;

  border-radius: 999px;

  background: #ffe16b;
  color: #493900;

  font-size: 10px;
  font-weight: 900;

  letter-spacing: 0.075em;
}

.lesson-teacher-image-wrap {
  position: relative;
  z-index: 2;

  width: 100%;
  min-height: 0;
  flex: 1;

  display: grid;
  place-items: end center;
}

.lesson-teacher-image-wrap::after {
  content: "";

  position: absolute;

  left: 50%;
  bottom: 2%;

  width: 72%;
  height: 35px;

  border-radius: 50%;

  background:
    radial-gradient(
      ellipse,
      rgba(30, 65, 48, 0.24),
      transparent 70%
    );

  transform:
    translateX(-50%)
    scaleY(0.4);

  filter: blur(6px);
}

.lesson-teacher-image {
  position: relative;
  z-index: 2;

  width: 100%;
  height: min(48vh, 420px);

  object-fit: contain;
  object-position: bottom center;

  filter:
    drop-shadow(
      0 22px 25px
      rgba(23, 49, 37, 0.22)
    );

  animation:
    lessonTeacherFloat
    4s ease-in-out infinite;
}

@keyframes lessonTeacherFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-7px);
  }
}

.lesson-speech-card {
  position: relative;
  z-index: 3;

  width: 100%;

  padding: 14px 15px;

  border: 1px solid #d7e1db;
  border-radius: 19px;

  background: #fff;

  color: #29463a;

  box-shadow:
    0 12px 25px
      rgba(42, 70, 56, 0.11);
}

.lesson-speech-card::before {
  content: "";

  position: absolute;

  left: 50%;
  top: -8px;

  width: 16px;
  height: 16px;

  background: #fff;

  border-left:
    1px solid #d7e1db;

  border-top:
    1px solid #d7e1db;

  transform:
    translateX(-50%)
    rotate(45deg);
}

.lesson-speech-card strong {
  display: block;

  font-size: 17px;
  font-weight: 900;
}

.lesson-speech-card p {
  margin: 4px 0 0;

  color: #5c7166;

  font-size: 12px;
  line-height: 1.35;
  font-weight: 750;
}

.lesson-voice-button {
  position: relative;
  z-index: 3;

  width: 100%;
  min-height: 47px;

  margin-top: 10px;

  border: 0;
  border-radius: 15px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 8px;

  background: #ffe16b;
  color: #473600;

  font-size: 12px;
  font-weight: 900;

  cursor: pointer;
}

.lesson-voice-icon {
  width: 29px;
  height: 29px;

  border-radius: 50%;

  display: grid;
  place-items: center;

  background:
    rgba(255, 255, 255, 0.64);
}

/* =========================================================
   CABECERA DE LA CLASE
   ========================================================= */

.learning-shell.lesson-mode
.learning-topbar {
  position: relative;
  z-index: 4;

  grid-area: topbar;

  min-height: 66px;

  padding: 0 25px;

  display: flex;
  align-items: center;

  gap: 13px;

  background: #fff;

  border-bottom:
    1px solid #e1e7e3;
}

.learning-shell.lesson-mode
.close-lesson-modal {
  width: 38px;
  height: 38px;

  flex: 0 0 38px;

  padding: 0;

  border: 1px solid #d9e1dc;
  border-radius: 50%;

  display: grid;
  place-items: center;

  background: #f5f7f6;
  color: #385548;

  font-size: 25px;
  line-height: 1;

  cursor: pointer;
}

.learning-shell.lesson-mode
.back-lesson {
  padding: 9px 13px;

  border: 1px solid #d9e2dc;

  background: #f4f7f5;
  color: #385548;
}

.learning-shell.lesson-mode
.lesson-path {
  color: #28483a;

  font-size: 14px;
  font-weight: 900;
}

.learning-shell.lesson-mode
.progress-dots {
  position: relative;

  width: min(260px, 30vw);
  height: 9px;

  margin-left: auto;

  border-radius: 999px;

  overflow: hidden;

  display: flex;

  gap: 0;

  background: #e4eae6;
}

.learning-shell.lesson-mode
.progress-dots span {
  height: 100%;
  flex: 1;

  width: auto;

  border-radius: 0;

  background: transparent;
}

.learning-shell.lesson-mode
.progress-dots span.active {
  background: #55b989;
  box-shadow: none;
}

/* =========================================================
   CONTENIDO EDUCATIVO
   ========================================================= */

.learning-shell.lesson-mode .board {
  position: relative;
  z-index: 3;

  grid-area: board;

  min-height: 0;

  margin: 22px 24px 24px;
  padding: 27px 29px;

  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 25px;

  overflow: auto;

  display: grid;

  grid-template-columns:
    minmax(260px, 0.82fr)
    minmax(350px, 1.18fr);

  grid-template-rows:
    minmax(0, 1fr)
    auto;

  gap: 22px;

  color: #253f34;

  background:
    linear-gradient(
      135deg,
      rgba(67, 102, 92, 0.746),
      rgba(84, 134, 184, 0.14)
    ),
    url("../../img/academia/fondo-aula.png")
      center center / cover no-repeat;

  box-shadow:
    0 22px 55px rgba(58, 131, 110, 0.825),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.learning-shell.lesson-mode
.board::before,
.learning-shell.lesson-mode
.board::after {
  display: none;
}

.learning-shell.lesson-mode
.board-copy {
  align-self: center;

  padding: 5px 5px 5px 2px;
}

.learning-shell.lesson-mode
.board-kicker {
  padding: 7px 11px;

  background: #3a7a5a;
  color: #ffffff;

  font-size: 10px;
}

.learning-shell.lesson-mode
.board h1 {
  margin: 13px 0 10px;

  color: #ffffff;

  font-size:
    clamp(31px, 3.1vw, 50px);

  line-height: 1.01;

  letter-spacing: -0.045em;
}

.learning-shell.lesson-mode
.board p {
  max-width: 560px;

  color: #ffffff;

  font-size: 15px;
  line-height: 1.5;
}

.learning-shell.lesson-mode
.board-visual {
  min-height: 320px;

  padding: 25px;

  border: 0;
  border-radius: 22px;

  background:
  linear-gradient(145deg, #f3de5d, #9de3d3);

  box-shadow:
    inset 0 0 0 1px
      rgba(73, 115, 92, 0.1);

  display: grid;
  place-items: center;
}

/* =========================================================
   RESPUESTA
   ========================================================= */

.learning-shell.lesson-mode
.answer-panel {
  grid-column: 1 / -1;

  padding: 18px 20px;

  border: 1px solid #ead997;
  border-radius: 19px;

  background: #fff8d9;
}

.learning-shell.lesson-mode
.question {
  margin-bottom: 11px;

  color: #3d3a26;

  font-size: 17px;
  line-height: 1.3;
}

.learning-shell.lesson-mode
.answer-actions {
  grid-template-columns:
    minmax(0, 1fr)
    auto;

  gap: 11px;
}

.learning-shell.lesson-mode
.answer-actions input {
  height: 56px;

  padding: 0 18px;

  border: 2px solid #d9dfdb;
  border-radius: 15px;

  font-size: 25px;
  text-align: center;

  background: #fff;
}

.learning-shell.lesson-mode
.answer-actions input:focus {
  border-color: #55b989;

  box-shadow:
    0 0 0 4px
      rgba(85, 185, 137, 0.14);
}

.learning-shell.lesson-mode
.answer-actions button {
  min-width: 150px;
  min-height: 56px;

  border-radius: 15px;

  background: #3b7d5e;

  font-size: 14px;
}

.learning-shell.lesson-mode
.answer-hint {
  margin-top: 9px;

  color: #6f6841;

  font-size: 12px;
}

/* No hay cards de materias dentro de la clase */

.learning-shell.lesson-mode
.choice-grid {
  display: none !important;
}

/* Ocultamos los elementos externos mientras está la clase */

body.lesson-modal-open
.header,
body.lesson-modal-open
.footer,
body.lesson-modal-open
.teacher-zone {
  filter: blur(3px);
  opacity: 0.3;

  pointer-events: none;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1000px) {

  .learning-shell.lesson-mode {
    inset: 10px;

    grid-template-columns:
      215px
      minmax(0, 1fr);
  }

  .learning-shell.lesson-mode
  .board {
    grid-template-columns: 1fr;
  }

  .learning-shell.lesson-mode
  .board-visual {
    min-height: 240px;
  }
}

@media (max-width: 720px) {

  .learning-shell.lesson-mode {
    inset: 6px;

    grid-template-columns: 1fr;

    grid-template-rows:
      58px
      auto
      minmax(0, 1fr);

    grid-template-areas:
      "topbar"
      "teacher"
      "board";

    overflow-y: auto;
  }

  .learning-shell.lesson-mode
  .lesson-teacher-panel {
    min-height: 190px;

    padding: 12px 15px;

    display: grid;

    grid-template-columns:
      110px
      minmax(0, 1fr);

    grid-template-rows:
      auto
      auto;

    gap: 8px 13px;

    border-right: 0;
    border-bottom:
      1px solid #d6e2da;
  }

  .lesson-teacher-badge {
    display: none;
  }

  .lesson-teacher-image-wrap {
    grid-row: 1 / 3;

    height: 165px;
  }

  .lesson-teacher-image {
    height: 165px;
  }

  .lesson-speech-card {
    align-self: end;
  }

  .lesson-voice-button {
    margin: 0;
  }

  .learning-shell.lesson-mode
  .learning-topbar {
    min-height: 58px;

    padding: 0 11px;
  }

  .learning-shell.lesson-mode
  .back-lesson {
    display: none;
  }

  .learning-shell.lesson-mode
  .progress-dots {
    width: 110px;
  }

  .learning-shell.lesson-mode
  .board {
    margin: 10px;

    padding: 18px;

    grid-template-columns: 1fr;

    overflow: visible;
  }

  .learning-shell.lesson-mode
  .board h1 {
    font-size: 32px;
  }

  .learning-shell.lesson-mode
  .board-visual {
    min-height: 210px;
  }

  .learning-shell.lesson-mode
  .answer-actions {
    grid-template-columns: 1fr;
  }

  .learning-shell.lesson-mode
  .answer-actions button {
    width: 100%;
  }
}

.star-token {
  animation:
    tokenPop 0.45s both,
    academyStarFloat 2.8s
      ease-in-out infinite;

  animation-delay:
    var(--token-delay, 0s),
    var(--token-delay, 0s);
}

.star-token:nth-child(1) {
  --token-delay: 0s;
}

.star-token:nth-child(2) {
  --token-delay: -0.45s;
}

.star-token:nth-child(3) {
  --token-delay: -0.9s;
}

.star-token:nth-child(4) {
  --token-delay: -1.35s;
}

@keyframes academyStarFloat {
  0%,
  100% {
    transform:
      translateY(0)
      rotate(-3deg)
      scale(1);
  }

  50% {
    transform:
      translateY(-8px)
      rotate(5deg)
      scale(1.08);
  }
}

/* .object-group {
  animation:
    academyGroupFloat
    3.5s ease-in-out infinite;

  transform-origin: center bottom;
}

.object-group:nth-child(1) {
  animation-delay: 0s;
}

.object-group:nth-child(2) {
  animation-delay: -0.8s;
}

.object-group:nth-child(3) {
  animation-delay: -1.6s;
}

.object-group:nth-child(4) {
  animation-delay: -2.4s;
}

@keyframes academyGroupFloat {
  0%,
  100% {
    transform:
      translateY(0)
      rotate(-1deg);
  }

  50% {
    transform:
      translateY(-7px)
      rotate(1deg);
  }
} */

.fruit {
  animation:
    tokenPop 0.45s both,
    academyFruitBounce
    2.9s ease-in-out infinite;

  animation-delay:
    var(--delay),
    var(--delay);
}

@keyframes academyFruitBounce {
  0%,
  100% {
    transform:
      translateY(0)
      rotate(-2deg);
  }

  45% {
    transform:
      translateY(-6px)
      rotate(3deg);
  }

  55% {
    transform:
      translateY(-6px)
      rotate(3deg);
  }
}

.fruit.is-removed {
  animation:
    academyFruitRemoved
    1.8s ease-in-out infinite;
}

@keyframes academyFruitRemoved {
  0%,
  100% {
    transform:
      translateY(16px)
      rotate(10deg)
      scale(0.92);
  }

  50% {
    transform:
      translateY(20px)
      rotate(14deg)
      scale(0.88);
  }
}

.candy {
  animation:
    tokenPop 0.4s both,
    academyCandyFloat
    2.6s ease-in-out infinite;
}

.candy:nth-child(2n) {
  animation-delay:
    -0.4s,
    -0.4s;
}

.candy:nth-child(3n) {
  animation-delay:
    -0.8s,
    -0.8s;
}

@keyframes academyCandyFloat {
  0%,
  100% {
    transform:
      translateY(0)
      rotate(-4deg);
  }

  50% {
    transform:
      translateY(-7px)
      rotate(5deg);
  }
}

.learning-shell.lesson-mode
.equation {
  position: relative;

  animation:
    academyEquationPulse
    2.6s ease-in-out infinite;

  box-shadow:
    0 11px 24px
      rgba(40, 91, 69, 0.2);
}

@keyframes academyEquationPulse {
  0%,
  100% {
    transform: scale(1);

    box-shadow:
      0 11px 24px
        rgba(40, 91, 69, 0.2);
  }

  50% {
    transform: scale(1.035);

    box-shadow:
      0 15px 31px
        rgba(40, 91, 69, 0.29);
  }
}

.learning-shell.lesson-mode
.board-visual {
  position: relative;
  overflow: hidden;
}

.learning-shell.lesson-mode
.board-visual::before,
.learning-shell.lesson-mode
.board-visual::after {
  content: "✦";

  position: absolute;

  color:
    rgba(255, 184, 76, 0.58);

  font-size: 25px;

  pointer-events: none;

  animation:
    academyVisualSpark
    4s ease-in-out infinite;
}

.learning-shell.lesson-mode
.board-visual::before {
  left: 7%;
  top: 12%;
}

.learning-shell.lesson-mode
.board-visual::after {
  right: 8%;
  bottom: 12%;

  color:
    rgba(70, 190, 153, 0.5);

  animation-delay: -2s;
}

@keyframes academyVisualSpark {
  0%,
  100% {
    opacity: 0.35;

    transform:
      translateY(0)
      rotate(0deg)
      scale(0.85);
  }

  50% {
    opacity: 0.9;

    transform:
      translateY(-10px)
      rotate(25deg)
      scale(1.2);
  }
}

/* =========================================================
   CELEBRACIÓN FINAL DE CLASE
   ========================================================= */

.lesson-celebration {
  position: relative;

  width: 100%;
  min-height: 100%;

  padding: 28px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  text-align: center;

  border-radius: 25px;

  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(255,232,105,.5),
      transparent 33%
    ),
    linear-gradient(
      145deg,
      rgba(244,251,247,.98),
      rgba(224,243,234,.94)
    );

  box-shadow:
    inset 0 0 0 1px
      rgba(255,255,255,.8);
}

.celebration-trophy {
  position: relative;
  z-index: 4;

  width: 112px;
  height: 112px;

  display: grid;
  place-items: center;

  border-radius: 34px;

  background:
    linear-gradient(
      145deg,
      #fff5a4,
      #ffc936
    );

  border:
    3px solid
    rgba(255,255,255,.84);

  box-shadow:
    0 24px 45px
      rgba(190,130,18,.28),
    inset 0 1px 0
      rgba(255,255,255,.9);

  font-size: 65px;

  animation:
    celebrationTrophy
    1.4s ease-in-out infinite alternate;
}

@keyframes celebrationTrophy {
  to {
    transform:
      translateY(-8px)
      rotate(4deg)
      scale(1.05);
  }
}

.celebration-title {
  position: relative;
  z-index: 4;

  margin-top: 19px;

  color: #264b3b;

  font-size:
    clamp(32px, 4vw, 52px);

  line-height: 1;
  font-weight: 900;
}

.celebration-copy {
  position: relative;
  z-index: 4;

  margin: 9px 0 0;

  color: #60736a;

  font-size: 15px;
  font-weight: 750;
}

.celebration-rewards {
  position: relative;
  z-index: 4;

  margin-top: 21px;

  display: flex;
  gap: 11px;
  flex-wrap: wrap;
  justify-content: center;
}

.celebration-rewards span {
  min-height: 47px;

  padding: 8px 14px;

  border-radius: 16px;

  display: flex;
  align-items: center;

  gap: 8px;

  background: #fff;

  border:
    1px solid
    rgba(73,114,94,.15);

  color: #3e5b4d;

  font-size: 12px;
  font-weight: 900;

  box-shadow:
    0 10px 22px
      rgba(47,80,63,.1);

  animation:
    rewardFloat
    3s ease-in-out infinite;
}

.celebration-rewards span:nth-child(2) {
  animation-delay: -1.3s;
}

.celebration-rewards b {
  font-size: 24px;
}

@keyframes rewardFloat {
  50% {
    transform: translateY(-5px);
  }
}

.celebration-actions {
  position: relative;
  z-index: 4;

  margin-top: 22px;

  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.celebration-button {
  min-height: 50px;

  padding: 0 21px;

  border-radius: 15px;

  font-size: 13px;
  font-weight: 900;

  cursor: pointer;

  transition:
    transform .2s ease,
    filter .2s ease;
}

.celebration-button:hover {
  transform: translateY(-3px);
  filter: brightness(1.04);
}

.celebration-button--primary {
  border: 0;

  background:
    linear-gradient(
      135deg,
      #fff19c,
      #ffd137
    );

  color: #473600;

  box-shadow:
    0 14px 27px
      rgba(187,136,21,.2);
}

.celebration-button--secondary {
  border:
    1px solid #cfdcd4;

  background:
    rgba(255,255,255,.86);

  color: #385749;
}

/* =========================================================
   ICONOS ORBITANDO
   ========================================================= */

.celebration-orbit {
  position: absolute;
  z-index: 2;

  width: 330px;
  height: 330px;

  left: 50%;
  top: 42%;

  border:
    1px dashed
    rgba(70,139,104,.23);

  border-radius: 50%;

  transform:
    translate(-50%,-50%);

  animation:
    celebrationOrbit
    16s linear infinite;
}

.celebration-orbit span {
  position: absolute;

  width: 51px;
  height: 51px;

  border-radius: 17px;

  display: grid;
  place-items: center;

  background:
    rgba(255,255,255,.83);

  border:
    1px solid
    rgba(255,255,255,.9);

  box-shadow:
    0 12px 23px
      rgba(38,72,55,.14);

  font-size: 27px;
}

.celebration-orbit span:nth-child(1) {
  left: 13%;
  top: 8%;
}

.celebration-orbit span:nth-child(2) {
  right: 7%;
  top: 29%;
}

.celebration-orbit span:nth-child(3) {
  right: 24%;
  bottom: 2%;
}

.celebration-orbit span:nth-child(4) {
  left: 3%;
  bottom: 27%;
}

@keyframes celebrationOrbit {
  to {
    transform:
      translate(-50%,-50%)
      rotate(360deg);
  }
}

.celebration-orbit span {
  animation:
    celebrationCounterRotate
    16s linear infinite;
}

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

/* =========================================================
   CONFETI
   ========================================================= */

.celebration-confetti {
  position: absolute;
  z-index: 1;

  inset: 0;

  pointer-events: none;
}

.celebration-confetti i {
  position: absolute;

  color: #ffd348;

  font-style: normal;
  font-size: 24px;

  animation:
    celebrationConfetti
    3.8s ease-in-out infinite;
}

.celebration-confetti i:nth-child(1) {
  left: 9%;
  top: 12%;
}

.celebration-confetti i:nth-child(2) {
  left: 21%;
  top: 27%;
  color: #66cfa2;
  animation-delay: -.7s;
}

.celebration-confetti i:nth-child(3) {
  right: 16%;
  top: 13%;
  color: #65b9ef;
  animation-delay: -1.4s;
}

.celebration-confetti i:nth-child(4) {
  right: 7%;
  top: 39%;
  color: #ff8178;
  animation-delay: -2s;
}

.celebration-confetti i:nth-child(5) {
  left: 12%;
  bottom: 13%;
  color: #9c89f0;
  animation-delay: -2.5s;
}

.celebration-confetti i:nth-child(6) {
  left: 36%;
  bottom: 6%;
  color: #65b9ef;
  animation-delay: -.9s;
}

.celebration-confetti i:nth-child(7) {
  right: 27%;
  bottom: 9%;
  color: #66cfa2;
  animation-delay: -1.8s;
}

.celebration-confetti i:nth-child(8) {
  right: 8%;
  bottom: 17%;
  color: #ffd348;
  animation-delay: -2.8s;
}

@keyframes celebrationConfetti {
  0%,
  100% {
    opacity: .35;

    transform:
      translateY(0)
      rotate(0)
      scale(.8);
  }

  50% {
    opacity: 1;

    transform: 
      translateY(-14px)
      rotate(24deg)
      scale(1.2);
  }
}
/* =========================================================
   ACADEMIA V2 — MISIONES INTERACTIVAS
   ========================================================= */
.academy-emoji-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(12px, 2vw, 24px);
  min-height: 120px;
  padding: 12px;
}

.academy-emoji-row > span {
  width: clamp(62px, 7vw, 94px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 26px;
  font-size: clamp(34px, 4vw, 58px);
  background: rgba(255,255,255,.82);
  box-shadow: 0 16px 34px rgba(54, 50, 105, .16);
  animation: academyTokenFloat 2.8s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.academy-word-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 8px auto 14px;
}

.academy-word-options span {
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  color: var(--academy-ink);
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(52,48,100,.11);
}

.academy-start-choice-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  min-height: 150px;
}

.academy-start-choice-visual span {
  width: clamp(78px, 9vw, 120px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 34px;
  font-size: clamp(44px, 5vw, 72px);
  background: rgba(255,255,255,.84);
  box-shadow: 0 18px 38px rgba(53,48,105,.18);
  animation: academyTokenFloat 3s ease-in-out infinite;
}

.academy-start-choice-visual span:last-child { animation-delay: -.8s; }
.academy-start-choice-visual b { font-size: 36px; color: #7d78ee; }

.academy-path-card {
  min-height: 170px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 30px;
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(238,245,255,.82));
  color: var(--academy-ink);
  box-shadow: 0 18px 42px rgba(43,42,96,.16);
  transition: transform .22s ease, box-shadow .22s ease;
}

.academy-path-card:hover,
.academy-path-card:focus-visible {
  transform: translateY(-7px) scale(1.02);
  box-shadow: 0 25px 50px rgba(43,42,96,.22);
}

.academy-path-card .path-emoji {
  font-size: 52px;
  animation: academyTokenFloat 2.5s ease-in-out infinite;
}

.academy-path-card strong { font-size: clamp(18px, 2vw, 25px); }
.academy-path-card small { max-width: 220px; font-weight: 700; opacity: .68; }

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

@media (max-width: 760px) {
  .academy-emoji-row { min-height: 92px; gap: 8px; }
  .academy-emoji-row > span { width: 58px; border-radius: 20px; font-size: 32px; }
  .academy-path-card { min-height: 128px; padding: 14px; }
  .academy-start-choice-visual { min-height: 105px; }
}


/* =========================================================
   ACADEMIA V3 — PROFESOR HÍBRIDO, AUDIO Y REVELADO VISUAL
   ========================================================= */
.academy-audio-controls{display:flex;align-items:center;gap:8px;padding:4px 8px;border:1px solid rgba(255,255,255,.24);border-radius:999px;background:rgba(20,52,45,.16)}
.academy-volume{width:92px;accent-color:var(--academy-yellow);cursor:pointer}
.academy-play-toggle{font-size:18px}
.academy-professor-character{width:min(100%,230px);height:auto;max-height:45vh;object-fit:contain;filter:drop-shadow(0 18px 22px rgba(25,56,43,.24));animation:academyProfessorFloat 3.8s ease-in-out infinite}
@keyframes academyProfessorFloat{50%{transform:translateY(-8px)}}
.intro-character img,.lesson-teacher-image{object-fit:contain}

/* La elección conserva el lenguaje circular del selector de materias. */
.choice-grid:has(.academy-path-card){display:flex!important;justify-content:center;align-items:flex-start;gap:clamp(28px,5vw,74px);padding-top:20px}
.academy-path-card{width:clamp(205px,20vw,270px)!important;min-height:300px!important;padding:0 12px 18px!important;border:0!important;background:transparent!important;box-shadow:none!important;text-align:center!important;display:flex!important;flex-direction:column;align-items:center;justify-content:flex-start}
.academy-path-card::before{display:none!important}
.path-orbit{position:relative;display:grid;place-items:center;width:clamp(170px,16vw,220px);aspect-ratio:1;border-radius:50%;background:linear-gradient(145deg,rgba(255,255,255,.98),rgba(235,255,245,.88));border:3px solid rgba(255,255,255,.86);box-shadow:0 20px 45px rgba(19,47,40,.24),inset 0 0 0 8px rgba(99,230,166,.16);transition:transform .25s ease,box-shadow .25s ease}
.academy-path-card--practice .path-orbit{background:linear-gradient(145deg,#fff9d9,#e8fff2);box-shadow:0 20px 45px rgba(19,47,40,.24),inset 0 0 0 8px rgba(255,216,79,.22)}
.academy-path-card:hover .path-orbit{transform:translateY(-7px) scale(1.035);box-shadow:0 28px 58px rgba(19,47,40,.3),inset 0 0 0 8px rgba(99,230,166,.2)}
.path-emoji{font-size:72px;filter:drop-shadow(0 9px 9px rgba(0,0,0,.12));animation:pathEmojiFloat 2.8s ease-in-out infinite}
.path-orbit i{position:absolute;font-style:normal;font-weight:900;color:#2d6655;animation:pathOrbit 6s linear infinite}
.path-orbit i:nth-of-type(1){top:14%;right:15%}.path-orbit i:nth-of-type(2){bottom:15%;left:14%;animation-delay:-2s}.path-orbit i:nth-of-type(3){bottom:19%;right:11%;animation-delay:-4s}
.academy-path-card strong{margin-top:16px;font-size:clamp(20px,2vw,28px);color:#fff;text-shadow:0 3px 12px rgba(14,47,38,.35)}
.academy-path-card small{max-width:210px;margin-top:5px;color:rgba(255,255,255,.9);font-size:14px;line-height:1.3}
@keyframes pathEmojiFloat{50%{transform:translateY(-7px) rotate(2deg)}}
@keyframes pathOrbit{50%{transform:translateY(-5px) rotate(8deg)}}

/* El tablero nace vacío y se construye al ritmo de la explicación. */
.board-visual .academy-reveal-item{opacity:0;transform:translateY(18px) scale(.82);filter:blur(3px)}
.board-visual.is-revealing .academy-reveal-item{animation:academyReveal .56s cubic-bezier(.2,.85,.25,1.25) forwards;animation-delay:var(--reveal-delay,0s)}
@keyframes academyReveal{to{opacity:1;transform:translateY(0) scale(1);filter:blur(0)}}
.board-visual.is-revealing .equation,.board-visual.is-revealing .helper-equation,.board-visual.is-revealing .count-line{animation-duration:.75s}

@media(max-width:850px){.academy-volume{display:none}.choice-grid:has(.academy-path-card){gap:18px}.academy-path-card{width:44%!important}.path-orbit{width:150px}.academy-path-card strong{font-size:19px}}

/* =========================================================
   ACADEMIA V3.2 — ELECCIÓN VISIBLE SOBRE EL FOOTER
   ========================================================= */
/* En la pantalla “repasar o ejercicios” compactamos y subimos
   el conjunto completo para que títulos y descripciones nunca
   queden debajo del footer. */
.learning-shell:not(.lesson-mode):has(.academy-path-card) {
  padding-bottom: 126px;
}

.learning-shell:not(.lesson-mode):has(.academy-path-card) .board {
  min-height: auto;
  padding-top: 56px;
  padding-bottom: 6px;
}

.learning-shell:not(.lesson-mode):has(.academy-path-card) .board-copy {
  transform: translateY(-22px);
}

.learning-shell:not(.lesson-mode):has(.academy-path-card) .choice-grid {
  transform: translateY(-34px);
  padding-bottom: 34px;
}

.learning-shell:not(.lesson-mode):has(.academy-path-card) .academy-path-card {
  min-height: 260px !important;
}

.learning-shell:not(.lesson-mode):has(.academy-path-card) .path-orbit {
  width: clamp(160px, 15vw, 205px);
}

.learning-shell:not(.lesson-mode):has(.academy-path-card) .academy-path-card strong {
  margin-top: 11px;
  line-height: 1.05;
}

@media (max-height: 820px) and (min-width: 851px) {
  .learning-shell:not(.lesson-mode):has(.academy-path-card) .board {
    padding-top: 42px;
  }

  .learning-shell:not(.lesson-mode):has(.academy-path-card) .board-copy {
    transform: translateY(-30px);
  }

  .learning-shell:not(.lesson-mode):has(.academy-path-card) .choice-grid {
    transform: translateY(-58px);
  }

  .learning-shell:not(.lesson-mode):has(.academy-path-card) .path-orbit {
    width: 185px;
  }
}


/* =========================================================
   AJUSTE FINAL — BIENVENIDA CENTRADA Y OBJETOS MÁS ATRACTIVOS
   ========================================================= */
@media (min-width: 901px) {
  .academy-intro {
    place-items: start center;
    padding-top: clamp(56px, 7vh, 82px);
  }

  .intro-card {
    height: min(520px, 76vh);
    transform: translateY(-10px);
    grid-template-columns: minmax(300px, .9fr) minmax(430px, 1.1fr);
    align-items: center;
  }

  .intro-character {
    align-self: center;
    place-items: center;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .intro-character img {
    height: min(440px, 61vh);
    object-position: center center;
  }

  .intro-character::before {
    bottom: 8%;
  }

  .intro-board {
    align-self: center;
    margin-top: 6px;
  }

  .start-academy {
    align-self: start;
    margin-top: -4px;
  }
}

.academy-counting-row {
  gap: clamp(10px, 1.2vw, 18px);
  align-items: center;
}

.academy-counting-token {
  display: inline-grid;
  place-items: center;
  width: clamp(42px, 4.1vw, 62px);
  height: clamp(42px, 4.1vw, 62px);
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1;
  filter: drop-shadow(0 8px 10px rgba(41, 55, 104, .18));
  animation: tokenPop .45s both;
  animation-delay: var(--delay);
  transform-origin: center;
}

.academy-counting-token.is-removed {
  opacity: .2;
  filter: grayscale(1) drop-shadow(0 5px 6px rgba(41, 55, 104, .12));
  transform: translateY(16px) rotate(10deg) scale(.84);
}


/* ================================================================
   ACADEMIA — CIERRE DE INTERACCIÓN Y PERSONAJE
   ================================================================ */

/* Centrado real de la etiqueta dentro de la columna del profesor. */
body.pk-academia .teacher-zone > .teacher-badge {
  left: 50% !important;
  right: auto !important;
  top: 18px !important;
  width: max-content !important;
  max-width: calc(100% - 28px) !important;
  margin: 0 !important;
  transform: translateX(-50%) !important;
  text-align: center !important;
}

/* El botón nace oculto y sólo ocupa lugar luego del cierre por inactividad. */
body.pk-academia #talkBtn[hidden],
body.pk-academia #talkBtn.is-startup-suppressed {
  display: none !important;
}

/* Dos capas precargadas: sin recarga de src, destellos ni halos transitorios. */
body.pk-academia #characterHolder.academy-character-dual {
  position: relative !important;
  display: block !important;
  overflow: visible !important;
  isolation: isolate;
  background: transparent !important;
  box-shadow: none !important;
}

body.pk-academia #characterHolder.academy-character-dual [data-academy-layer] {
  position: absolute !important;
  left: 50% !important;
  bottom: 0 !important;
  width: min(310px, 23vw) !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center bottom !important;
  margin: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateX(-50%) !important;
  animation: none !important;
  transition: none !important;
  filter: drop-shadow(0 30px 36px rgba(0,0,0,.4)) !important;
  background: transparent !important;
  pointer-events: none !important;
}

body.pk-academia #characterHolder.academy-character-dual [data-academy-layer].is-visible {
  opacity: 1 !important;
  visibility: visible !important;
}

@media (max-width: 1199px) {
  body.pk-academia #characterHolder.academy-character-dual [data-academy-layer] {
    width: min(300px, 27vw) !important;
  }
}


/* ACADEMIA — ajustes independientes para los WebP de profesor */
body.pk-academia .lumi-profe-escucha-webp { --pk-professor-scale: 1; --pk-professor-x: 0px; --pk-professor-y: 0px; }
body.pk-academia .lumi-profe-habla-webp   { --pk-professor-scale: 1; --pk-professor-x: 0px; --pk-professor-y: 0px; }
body.pk-academia .roki-profe-escucha-webp { --pk-professor-scale: 1; --pk-professor-x: 0px; --pk-professor-y: 0px; }
body.pk-academia .roki-profe-habla-webp   { --pk-professor-scale: 1; --pk-professor-x: 0px; --pk-professor-y: 0px; }
body.pk-academia #characterHolder.academy-character-dual [data-academy-layer] {
  transform: translate3d(calc(-50% + var(--pk-professor-x, 0px)), var(--pk-professor-y, 0px), 0) scale(var(--pk-professor-scale, 1)) !important;
  transform-origin: center bottom !important;
}

/* =====================================================================
   ACADEMIA — ESCENARIO FIJO DEL PROFESOR
   Replica la separación visual de Index: personaje y controles viven en
   zonas independientes y ningún estado de voz modifica la geometría.
   ===================================================================== */
body.pk-academia {
  --pk-academy-character-width: 460px;
  --pk-academy-controls-bottom: 54px;
  --pk-academy-controls-height: 94px;
  --pk-academy-character-clearance: 38px;
}

body.pk-academia .teacher-zone {
  position: relative !important;
  display: block !important;
  min-width: 0 !important;
  overflow: visible !important;
}

body.pk-academia .academy-character-stage {
  position: absolute !important;
  inset: 52px 0 calc(var(--pk-academy-controls-bottom) + var(--pk-academy-controls-height) + var(--pk-academy-character-clearance)) 0 !important;
  overflow: visible !important;
  pointer-events: none !important;
}

body.pk-academia #characterHolder,
body.pk-academia #characterHolder.academy-character-dual {
  position: absolute !important;
  left: 50% !important;
  bottom: 0 !important;
  width: 0 !important;
  height: 100% !important;
  display: block !important;
  overflow: visible !important;
  transform: translateX(-50%) !important;
  animation: none !important;
  transition: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.pk-academia #characterHolder.academy-character-dual [data-academy-layer] {
  position: absolute !important;
  left: 50% !important;
  bottom: 0 !important;
  display: block !important;
  width: var(--pk-academy-character-width) !important;
  min-width: var(--pk-academy-character-width) !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center bottom !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform:
    translate3d(
      calc(-50% + var(--pk-professor-x, 0px)),
      var(--pk-professor-y, 0px),
      0
    )
    scale(var(--pk-professor-scale, 1)) !important;
  transform-origin: center bottom !important;
  animation: none !important;
  transition: opacity 80ms linear, visibility 0s linear 80ms !important;
  will-change: opacity !important;
  filter: drop-shadow(0 28px 38px rgba(0,0,0,.38)) !important;
}

body.pk-academia #characterHolder.academy-character-dual [data-academy-layer].is-visible {
  opacity: 1 !important;
  visibility: visible !important;
  transition: opacity 80ms linear, visibility 0s linear 0s !important;
}

body.pk-academia .academy-assistant-controls {
  position: absolute !important;
  left: 50% !important;
  bottom: var(--pk-academy-controls-bottom) !important;
  width: min(280px, 94%) !important;
  min-height: var(--pk-academy-controls-height) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  transform: translateX(-50%) !important;
  z-index: 20 !important;
  pointer-events: none !important;
}

body.pk-academia .academy-assistant-controls .teacher-message {
  width: 100% !important;
  margin: 0 !important;
  pointer-events: auto !important;
}

body.pk-academia .academy-assistant-controls .talk-button {
  margin: 0 !important;
  pointer-events: auto !important;
}

/* Calibración individual de cada archivo, igual que en Index. */
body.pk-academia .lumi-profe-escucha-webp { --pk-professor-scale: 1; --pk-professor-x: 0px; --pk-professor-y: 0px; }
body.pk-academia .lumi-profe-habla-webp   { --pk-professor-scale: 1; --pk-professor-x: 0px; --pk-professor-y: 0px; }
body.pk-academia .roki-profe-escucha-webp { --pk-professor-scale: 1; --pk-professor-x: 0px; --pk-professor-y: 0px; }
body.pk-academia .roki-profe-habla-webp   { --pk-professor-scale: 1; --pk-professor-x: 0px; --pk-professor-y: 0px; }

@media (max-width: 1199px) {
  body.pk-academia {
    --pk-academy-character-width: 430px;
    --pk-academy-controls-bottom: 26px;
  }
}

@media (max-width: 900px) {
  body.pk-academia {
    --pk-academy-character-width: min(460px, 92vw);
    --pk-academy-controls-bottom: 18px;
  }
}

/* =====================================================================
   ACADEMIA — AJUSTE FINAL DE TAMAÑOS DEL PROFESOR
   Pantalla principal y clase usan escalas independientes.
   ===================================================================== */

/* Pantalla principal: un poco más pequeño, sin mover controles. */
body.pk-academia {
  --pk-academy-character-width: 340px;
}

/* Vista de explicación/ejercicios: agranda el personaje dentro del panel. */
body.pk-academia .learning-shell.lesson-mode .lesson-teacher-image-wrap {
  overflow: visible;
}

body.pk-academia .learning-shell.lesson-mode .lesson-teacher-image {
  width: 118%;
  max-width: none;
  height: min(55vh, 500px);
  transform-origin: center bottom;
  animation: lessonTeacherFloatLarge 4s ease-in-out infinite;
}

@keyframes lessonTeacherFloatLarge {
  0%,
  100% {
    transform: translateY(0) scale(1.18);
  }

  50% {
    transform: translateY(-7px) scale(1.18);
  }
}

/* Notebook */
@media (min-width: 901px) and (max-width: 1199px) {
  body.pk-academia {
    --pk-academy-character-width: 390px;
  }
}

/* Tablet y móvil: mantener proporciones seguras. */
@media (max-width: 900px) {
  body.pk-academia {
    --pk-academy-character-width: min(410px, 88vw);
  }

  body.pk-academia .learning-shell.lesson-mode .lesson-teacher-image {
    width: 100%;
    height: 180px;
    animation: lessonTeacherFloatMobileLarge 4s ease-in-out infinite;
  }

  @keyframes lessonTeacherFloatMobileLarge {
    0%,
    100% {
      transform: translateY(0) scale(1.08);
    }

    50% {
      transform: translateY(-5px) scale(1.08);
    }
  }
}
