:root {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #fff;
  background: #111827;
  --accent: #12d4e2;
  --accent-dark: #0d8fd3;
  --ink: #1a1f48;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: #111827;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

button {
  font: inherit;
}

#app {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

.cover,
.finish,
.game-shell {
  position: absolute;
  inset: 0;
  display: none;
}

.cover.active {
  display: block;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.finish.active {
  display: grid;
  place-items: center;
}
.game-shell.active {
  display: grid;
  place-items: center;
  background: #0b1220;
}

.cover,
.finish {
  background:
    radial-gradient(
      circle at 22% 24%,
      rgba(196, 136, 255, 0.28),
      transparent 26%
    ),
    radial-gradient(
      circle at 78% 28%,
      rgba(76, 201, 240, 0.26),
      transparent 24%
    ),
    linear-gradient(135deg, rgba(5, 9, 25, 0.94), rgba(22, 40, 74, 0.9));
}

.finish {
  background-image:
    linear-gradient(rgba(4, 12, 24, 0.45), rgba(4, 12, 24, 0.8)),
    url("../assets/backgrounds/background_2.jpg");
  background-size: cover;
  background-position: center;
}

.cover-layout {
  width: min(1280px, calc(100% - 36px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(14px, 2vw, 28px);
  align-items: center;
}

.cover-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(12px, 2vh, 22px);
  min-width: 0;
}

.cover-logo {
  width: min(100%, 820px);
  max-height: 34vh;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.35));
}

.cover-bubble {
  width: min(100%, 760px);
  padding: clamp(18px, 2.3vw, 28px) clamp(18px, 2.5vw, 30px);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border: 4px solid #2588e6;
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.25);
}

.cover-bubble h1 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 2.6vw, 2.5rem);
  line-height: 1.05;
}

.cover-bubble p {
  margin: 0;
  font-size: clamp(0.98rem, 1.55vw, 1.25rem);
  line-height: 1.45;
}

.cover-right {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.cover-avatar-column {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.cover-avatar-wrap {
  width: min(100%, 390px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.cover-avatar {
  display: block;
  width: 100%;
  max-height: 66vh;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.28));
}

.avatar-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
}

.primary-button,
.secondary-button,
.continue-button {
  border: 0;
  border-radius: 18px;
  padding: 14px 26px;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 120ms ease,
    filter 120ms ease,
    box-shadow 120ms ease;
}

.primary-button,
.continue-button {
  background: linear-gradient(180deg, #20e6ef, #08b8d5);
  color: white;
  box-shadow: 0 12px 28px rgba(17, 194, 223, 0.3);
}

.primary-button:hover,
.continue-button:hover,
.audio-icon-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.start-button {
  min-width: 170px;
  min-height: 54px;
  font-size: 1.05rem;
}

.audio-icon-button {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  background: linear-gradient(180deg, #20e6ef, #08b8d5);
  color: white;
  box-shadow: 0 12px 28px rgba(17, 194, 223, 0.3);
  transition:
    transform 120ms ease,
    filter 120ms ease,
    box-shadow 120ms ease;
}

.audio-icon {
  width: 28px;
  height: 28px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.audio-icon path:nth-child(2),
.audio-icon path:nth-child(3) {
  fill: none;
}

.audio-icon-button.is-speaking {
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.18),
    0 0 0 9px rgba(18, 212, 226, 0.24),
    0 12px 28px rgba(17, 194, 223, 0.35);
}

.cover-card {
  width: min(620px, calc(100% - 32px));
  padding: 38px;
  text-align: center;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.brand {
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: 0.02em;
}
.cover-card h1 {
  margin: 0.35rem 0 0.75rem;
}
.cover-card p {
  margin: 0 auto 1.6rem;
  max-width: 46ch;
  line-height: 1.55;
  color: #dbeafe;
}

.game-viewport {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  width: min(100vw, calc(100dvh * 16 / 9));
  aspect-ratio: 16 / 9;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  background: #1f2937;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 18px 70px rgba(0, 0, 0, 0.5);
}

.background {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
}
.background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.12),
    rgba(0, 0, 0, 0.05) 60%,
    rgba(0, 0, 0, 0.2)
  );
  pointer-events: none;
}

.hud {
  position: absolute;
  z-index: 20;
  inset: 0 0 auto 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  font-weight: 700;
}

.scene-audio-button {
  position: absolute;
  z-index: 40;
  top: 70px;
  right: 3%;
  width: 54px;
  height: 54px;
  padding: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(180deg, #20e6ef, #08b8d5);
  color: white;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}

.scene-audio-button:hover {
  transform: scale(1.06);
  filter: brightness(1.07);
}

.scene-audio-button:active {
  transform: scale(0.96);
}

.scene-audio-icon {
  width: 27px;
  height: 27px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scene-audio-icon path:nth-child(2),
.scene-audio-icon path:nth-child(3) {
  fill: none;
}

.scene-audio-button.is-playing {
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.18),
    0 0 0 9px rgba(18, 212, 226, 0.24),
    0 8px 22px rgba(0, 0, 0, 0.28);
}

@media (max-width: 900px) {
  .scene-audio-button {
    width: 46px;
    height: 46px;
    top: 56px;
    right: 2%;
  }

  .scene-audio-icon {
    width: 23px;
    height: 23px;
  }
}

.cards-layer {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

.information-card {
  position: absolute;
  /* quitar esto */
  /* transform: translate(-50%, -50%); */

  min-width: 210px;
  max-width: 290px;
  padding: 22px 25px;
  border: 4px solid #d1a843;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff8c7, #ffe98d);
  color: #513626;
  font-size: clamp(1rem, 2vw, 1.55rem);
  font-weight: 800;
  text-align: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  pointer-events: auto;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transition: box-shadow 0.15s ease;
}

.information-card.dragging {
  cursor: grabbing;
  z-index: 100;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
}

.information-card:hover {
  box-shadow: 0 13px 30px rgba(0, 0, 0, 0.34);
}

.information-card.dragging {
  cursor: grabbing;
  z-index: 100;
  transform: translate(-50%, -50%) scale(1.04);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
}

@media (max-width: 900px) {
  .information-card {
    min-width: 150px;
    max-width: 210px;
    padding: 14px 16px;
    font-size: clamp(0.82rem, 2vw, 1.15rem);
  }
}

.npc {
  position: absolute;
  z-index: 11;
  left: auto;
  right: 1.5%;
  bottom: 0;
  width: 24%;
  max-height: 68%;
  object-fit: contain;
  object-position: bottom right;
  pointer-events: none;
  filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.28));
}

.speech-bubble {
  position: absolute;
  z-index: 12;
  left: 20%;
  top: 13%;
  width: min(54%, 520px);
  min-height: 102px;
  padding: 18px 22px;
  border: 3px solid #1f2937;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  line-height: 1.45;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  font-size: clamp(0.9rem, 1.8vw, 1.15rem);
}

.speech-bubble::after {
  content: "";
  position: absolute;
  left: 48px;
  bottom: -21px;
  border: 10px solid transparent;
  border-top-color: #1f2937;
}

.items-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
.game-item {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transition:
    transform 120ms ease,
    filter 120ms ease;
}
.game-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.28));
}
.game-item:hover,
.game-item:focus-visible {
  transform: translate(-50%, -50%) scale(1.06);
  outline: none;
}
.game-item:active {
  transform: translate(-50%, -50%) scale(0.98);
}
.game-item.correct-pulse {
  animation: correctPulse 0.5s ease;
}
.game-item.wrong-shake {
  animation: wrongShake 0.35s ease;
}
@keyframes correctPulse {
  50% {
    transform: translate(-50%, -50%) scale(1.13);
  }
}
@keyframes wrongShake {
  25% {
    transform: translate(calc(-50% - 7px), -50%);
  }
  75% {
    transform: translate(calc(-50% + 7px), -50%);
  }
}

.continue-button {
  position: absolute;
  z-index: 30;
  right: 3%;
  bottom: 5%;
}
.hidden {
  display: none !important;
}

/* TABLET: conservar dos columnas y reducir altura */
@media (max-width: 1100px) {
  .cover-layout {
    width: min(calc(100% - 24px), 1000px);
    grid-template-columns: minmax(0, 1.08fr) minmax(250px, 0.72fr);
    gap: 12px;
    padding: 12px 0;
  }

  .cover-left {
    gap: 12px;
  }
  .cover-logo {
    width: min(100%, 650px);
    max-height: 27vh;
  }
  .cover-bubble {
    padding: 16px 18px;
    border-width: 3px;
    border-radius: 24px;
  }
  .cover-bubble h1 {
    font-size: clamp(1.25rem, 2.4vw, 1.9rem);
    margin-bottom: 6px;
  }
  .cover-bubble p {
    font-size: clamp(0.9rem, 1.65vw, 1.08rem);
    line-height: 1.35;
  }
  .cover-avatar-wrap {
    width: min(100%, 310px);
  }
  .cover-avatar {
    max-height: 58vh;
  }
  .start-button {
    min-width: 145px;
    min-height: 48px;
    padding: 11px 20px;
  }
  .audio-icon-button {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
  }
  .audio-icon {
    width: 24px;
    height: 24px;
  }
}

/* Tablet horizontal o pantallas de poca altura */
@media (max-height: 720px) and (min-width: 701px) {
  .cover-layout {
    padding: 8px 0;
  }
  .cover-logo {
    max-height: 29vh;
  }
  .cover-bubble {
    padding: 12px 16px;
  }
  .cover-bubble h1 {
    font-size: 1.35rem;
  }
  .cover-bubble p {
    font-size: 0.9rem;
    line-height: 1.28;
  }
  .cover-avatar-wrap {
    width: min(100%, 270px);
  }
  .cover-avatar {
    max-height: 60vh;
  }
  .avatar-actions {
    gap: 9px;
  }
  .start-button {
    min-height: 44px;
    min-width: 135px;
    padding: 9px 18px;
  }
  .audio-icon-button {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }
}

/* TELÉFONO: apilar y permitir desplazamiento */
@media (max-width: 700px) {
  .cover.active {
    overflow-y: auto;
  }
  .cover-layout {
    width: min(calc(100% - 20px), 620px);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px 0 22px;
  }

  .cover-left {
    align-items: center;
    text-align: center;
    gap: 12px;
    width: 100%;
  }
  .cover-logo {
    width: min(100%, 500px);
    max-height: 21vh;
    object-position: center;
  }
  .cover-bubble {
    width: 100%;
    padding: 14px 16px;
    border-radius: 22px;
  }
  .cover-bubble h1 {
    font-size: 1.35rem;
  }
  .cover-bubble p {
    font-size: 0.92rem;
    line-height: 1.35;
  }
  .cover-right {
    width: 100%;
  }
  .cover-avatar-column {
    gap: 8px;
  }
  .cover-avatar-wrap {
    width: min(230px, 62vw);
  }
  .cover-avatar {
    max-height: 34vh;
  }
  .avatar-actions {
    gap: 10px;
    padding-bottom: 4px;
  }
  .start-button {
    min-width: 150px;
    width: auto;
  }
  .audio-icon-button {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
  }

  .hud {
    height: 42px;
    font-size: 0.78rem;
  }
  .speech-bubble {
    left: 20%;
    top: 12%;
    width: 68%;
    min-height: 70px;
    padding: 10px 12px;
    border-width: 2px;
  }
  .npc {
    width: 20%;
  }
  .continue-button {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
}

@media (max-width: 420px) {
  .cover-logo {
    max-height: 18vh;
  }
  .cover-bubble p {
    font-size: 0.86rem;
  }
  .cover-avatar-wrap {
    width: min(205px, 58vw);
  }
  .cover-avatar {
    max-height: 30vh;
  }
  .start-button {
    min-width: 138px;
    min-height: 46px;
    padding: 10px 18px;
  }
  .audio-icon-button {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }
}

/* =========================================================
   MiPDM v5.0 - ESCENA 2
   ========================================================= */

.scene-layer {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

.scene-layer > * {
  pointer-events: auto;
}

.classification-wrap {
  position: absolute;
  inset: 0;
}

.classification-board {
  position: absolute;
  left: 34%;
  top: 33%;
  width: 61%;
  height: 53%;
  padding: 1.1rem 1.2rem 1rem;
  border-radius: 24px;
  border: 4px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(
    180deg,
    rgba(32, 39, 79, 0.78),
    rgba(24, 29, 63, 0.68)
  );
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.32),
    inset 0 0 0 2px rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(2px);
}

.board-caption {
  margin-bottom: 0.8rem;
  color: #ffffff;
  font-size: clamp(1.1rem, 2vw, 1.7rem);
  font-weight: 800;
}

.zones-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: calc(100% - 7.7rem);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  overflow: hidden;
}

.drop-zone {
  position: relative;
  min-height: 100%;
  padding: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(16, 20, 46, 0.22);
}

.drop-zone:last-child {
  border-right: none;
}

.zone-header {
  padding: 0.9rem 0.8rem;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(84, 140, 214, 0.85),
    rgba(70, 124, 197, 0.65)
  );
  border-bottom: 2px solid rgba(255, 255, 255, 0.16);
  color: #f8fbff;
}

.zone-title {
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  font-weight: 800;
}

.zone-subtitle {
  margin-top: 0.18rem;
  font-size: clamp(0.74rem, 1.3vw, 1rem);
  opacity: 0.96;
}

.placed-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 0.9rem;
  min-height: calc(100% - 5.4rem);
}

.missing-placeholder {
  position: absolute;
  right: 10%;
  left: 10%;
  top: 54%;
  transform: translateY(-50%);
  min-height: 84px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(4px);
  color: rgba(20, 25, 45, 0.48);
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  font-weight: 800;
  display: grid;
  place-items: center;
  filter: blur(1.6px);
  pointer-events: none;
}

.label-tray {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 0.8rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0.9rem;
  min-height: 70px;
}

.drag-label,
.placed-stack .drag-label,
.information-card.static-card {
  border: 4px solid #d1a843;
  border-radius: 10px;
  background: linear-gradient(145deg, #fff8c7, #ffe98d);
  color: #513626;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  font-weight: 800;
  line-height: 1.2;
}

.drag-label {
  min-width: 180px;
  max-width: 250px;
  padding: 14px 18px;
  text-align: center;
  font-size: clamp(0.85rem, 1.45vw, 1.12rem);
  cursor: grab;
  user-select: none;
  touch-action: none;
  z-index: 24;
}

.drag-label.is-absolute {
  position: absolute;
}

.drag-label.dragging {
  cursor: grabbing;
  z-index: 35;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.42);
  transform: scale(1.03);
}

.drag-label.placed {
  position: relative;
  left: auto !important;
  top: auto !important;
  transform: none;
  width: auto;
  max-width: none;
  cursor: default;
  pointer-events: none;
}

.drop-zone.zone-correct {
  animation: zoneOk 0.35s ease;
}

.drop-zone.zone-wrong {
  animation: zoneNo 0.35s ease;
}

@keyframes zoneOk {
  50% {
    box-shadow: inset 0 0 0 999px rgba(57, 190, 109, 0.14);
  }
}

@keyframes zoneNo {
  50% {
    box-shadow: inset 0 0 0 999px rgba(230, 65, 65, 0.14);
  }
}

.information-card.static-card {
  transform: translate(-50%, -50%);
  cursor: default;
  user-select: none;
  touch-action: auto;
  pointer-events: none;
  min-width: 190px;
  max-width: 255px;
  padding: 16px 18px;
  font-size: clamp(0.9rem, 1.65vw, 1.28rem);
  line-height: 1.25;
  z-index: 26;
}

.game-item.chest-opened {
  cursor: default;
}

.game-item.chest-opened:hover,
.game-item.chest-opened:focus-visible {
  transform: translate(-50%, -50%);
}

.continue-button {
  position: absolute;
  z-index: 45;
  right: 3%;
  bottom: 4%;
  min-width: 145px;
  min-height: 48px;
  font-size: 1rem;
}

.cards-layer {
  pointer-events: none;
}

@media (max-width: 1100px) {
  .classification-board {
    left: 31%;
    top: 34%;
    width: 66%;
    height: 54%;
    padding: 0.9rem 0.9rem 0.8rem;
  }

  .label-tray {
    gap: 0.6rem;
  }

  .drag-label {
    min-width: 148px;
    max-width: 205px;
    padding: 10px 12px;
    font-size: clamp(0.75rem, 1.3vw, 0.96rem);
  }

  .missing-placeholder {
    min-height: 68px;
  }
}

@media (max-width: 900px) {
  .information-card.static-card {
    min-width: 135px;
    max-width: 180px;
    padding: 10px 12px;
    font-size: clamp(0.72rem, 1.7vw, 0.98rem);
    border-width: 3px;
  }

  .classification-board {
    left: 29%;
    top: 37%;
    width: 68%;
    height: 50%;
    border-radius: 18px;
  }

  .zones-grid {
    height: calc(100% - 6.6rem);
  }

  .zone-header {
    padding: 0.55rem 0.45rem;
  }

  .zone-title {
    font-size: clamp(0.78rem, 1.5vw, 1.1rem);
  }

  .zone-subtitle {
    font-size: clamp(0.62rem, 1.1vw, 0.82rem);
  }

  .placed-stack {
    gap: 0.45rem;
    padding: 0.6rem;
  }

  .drag-label {
    min-width: 108px;
    max-width: 150px;
    padding: 8px 10px;
    border-width: 3px;
    font-size: clamp(0.62rem, 1.2vw, 0.82rem);
  }

  .missing-placeholder {
    right: 9%;
    left: 9%;
    top: 56%;
    min-height: 52px;
    font-size: clamp(0.82rem, 1.4vw, 1rem);
  }

  .continue-button {
    right: 2%;
    bottom: 3%;
    min-width: 120px;
    min-height: 42px;
    padding: 9px 15px;
    font-size: 0.85rem;
  }
}

/* =========================================================
   MiPDM v6.0 - POSICIÓN DEL NPC
   ========================================================= */

.npc.npc-left {
  left: 1.5%;
  right: auto;
  transform: none;
}

.npc.npc-center {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.npc.npc-right {
  left: auto;
  right: 1.5%;
  transform: none;
}

/* =========================================================
   MiPDM v6.0 - ESCENA 3
   ========================================================= */

.scene3-wrap {
  position: absolute;
  left: 20%;
  right: 2.5%;
  top: 31%;
  bottom: 5%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  pointer-events: none;
}

.scene3-summary-panel,
.scene3-question-panel {
  min-width: 0;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  background: linear-gradient(
    180deg,
    rgba(32, 39, 79, 0.84),
    rgba(24, 29, 63, 0.76)
  );
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.32),
    inset 0 0 0 2px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(2px);
  overflow: hidden;
}

.scene3-summary-panel {
  padding: 0.95rem;
}

.scene3-panel-title {
  color: #fff;
  font-weight: 800;
  font-size: clamp(1rem, 1.55vw, 1.35rem);
  margin-bottom: 0.65rem;
}

.scene3-summary-grid {
  height: calc(100% - 2.2rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.scene3-summary-column {
  min-width: 0;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(12, 18, 44, 0.25);
}

.scene3-zone-header {
  padding: 0.65rem 0.5rem;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(84, 140, 214, 0.88),
    rgba(70, 124, 197, 0.7)
  );
  color: #fff;
}

.scene3-zone-title {
  font-size: clamp(0.78rem, 1.25vw, 1.05rem);
  font-weight: 800;
}

.scene3-zone-subtitle {
  margin-top: 0.12rem;
  font-size: clamp(0.62rem, 1vw, 0.82rem);
}

.scene3-static-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 0.65rem;
}

.scene3-static-label {
  padding: 0.8rem 0.75rem;
  border: 3px solid #d1a843;
  border-radius: 10px;
  background: linear-gradient(145deg, #fff8c7, #ffe98d);
  color: #513626;
  font-size: clamp(0.72rem, 1.15vw, 0.98rem);
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.scene3-missing-label {
  background: linear-gradient(145deg, #fff8c7, #f6e2a0);
}

/* PANEL DE RESPUESTAS */

.scene3-question-panel {
  padding: 1rem;
  pointer-events: auto;
}

.scene3-question {
  padding: 0.8rem 0.9rem;
  margin-bottom: 0.8rem;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: clamp(1rem, 1.55vw, 1.3rem);
  font-weight: 800;
}

.scene3-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.scene3-option {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.75rem 0.45rem 0.45rem;
  border: 2px solid rgba(138, 204, 255, 0.55);
  border-radius: 13px;
  background: linear-gradient(
    90deg,
    rgba(44, 91, 150, 0.8),
    rgba(48, 62, 111, 0.72)
  );
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease,
    box-shadow 0.12s ease;
}

.scene3-option:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(164, 220, 255, 0.95);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.scene3-option:disabled {
  cursor: default;
}

.scene3-option-letter {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(180deg, #c9edff, #75bbdf);
  color: #173253;
  font-size: 1.4rem;
  font-weight: 900;
}

.scene3-option-text {
  font-size: clamp(0.76rem, 1.08vw, 1rem);
  font-weight: 700;
  line-height: 1.22;
}

.scene3-option.wrong-option {
  animation: scene3Wrong 0.34s ease;
  border-color: rgba(255, 100, 100, 0.95);
}

.scene3-option.correct-option {
  border-color: rgba(100, 255, 166, 0.95);
  background: linear-gradient(
    90deg,
    rgba(38, 134, 91, 0.88),
    rgba(42, 93, 83, 0.8)
  );
  box-shadow:
    0 0 0 3px rgba(98, 228, 153, 0.15),
    0 10px 22px rgba(0, 0, 0, 0.22);
}

@keyframes scene3Wrong {
  25% {
    transform: translateX(-7px);
  }

  75% {
    transform: translateX(7px);
  }
}

/* TABLET */

@media (max-width: 1100px) {
  .scene3-wrap {
    left: 22%;
    top: 34%;
    right: 2%;
    bottom: 4%;
    gap: 0.7rem;
  }

  .scene3-summary-panel,
  .scene3-question-panel {
    border-radius: 17px;
  }

  .scene3-summary-panel,
  .scene3-question-panel {
    padding: 0.65rem;
  }

  .scene3-options {
    gap: 0.42rem;
  }

  .scene3-option {
    min-height: 46px;
    grid-template-columns: 38px 1fr;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  }

  .scene3-option-letter {
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
  }

  .scene3-static-stack {
    gap: 0.42rem;
    padding: 0.55rem 0.45rem;
  }

  .scene3-static-label {
    padding: 0.55rem 0.5rem;
  }
}

@media (max-width: 800px) {
  .scene3-wrap {
    left: 20%;
    top: 36%;
    grid-template-columns: 0.95fr 1.05fr;
  }

  .scene3-panel-title {
    margin-bottom: 0.4rem;
  }

  .scene3-zone-header {
    padding: 0.42rem 0.3rem;
  }

  .scene3-question {
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.5rem;
  }

  .scene3-option {
    min-height: 39px;
  }
}

.reference-scene {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

.reference-chest {
  position: absolute;
  transform: translate(-50%, -50%);
}

.reference-chest img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.28));
}

.reference-label {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 190px;
  max-width: 260px;
  padding: 14px 18px;
  border: 4px solid #d1a843;
  border-radius: 12px;
  background: linear-gradient(145deg, #fff8c7, #ffe98d);
  color: #513626;
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  font-weight: 800;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.reference-label-initial {
  border-color: #6ea8d9;
  background: linear-gradient(145deg, #e8f4ff, #cfe7ff);
  color: #1e3f5a;
}

/* =========================================================
   ESCENA 5 - CONSTRUCTOR DE ECUACIÓN
   ========================================================= */

.equation-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.equation-instruction {
  position: absolute;
  /* Las casillas objetivo comienzan al 47%: mantener el título 10px encima. */
  bottom: calc(53% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: min(74%, 850px);
  padding: 8px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: #30344f;
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  font-weight: 700;
  text-align: center;
}

/* ESPACIOS DE LA ECUACIÓN */

.equation-slots {
  position: absolute;
  top: 47%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  pointer-events: auto;
}

.equation-slot {
  width: clamp(62px, 7vw, 95px);
  height: clamp(62px, 7vw, 95px);
  display: grid;
  place-items: center;
  border: 4px solid rgba(255, 222, 126, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 0 16px rgba(255, 218, 100, 0.14);
}

/* BLOQUES DESORDENADOS */

.equation-blocks {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  justify-content: center;
  pointer-events: auto;
}

.equation-block {
  width: clamp(62px, 7vw, 95px);
  height: clamp(62px, 7vw, 95px);
  display: grid;
  place-items: center;
  border: 4px solid rgba(255, 255, 255, 0.22);
  border-radius: 13px;
  background: linear-gradient(145deg, #d34b72, #973d70);
  color: #fff8cf;
  font-size: clamp(1.7rem, 4vw, 3rem);
  font-weight: 900;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.equation-block:nth-child(2) {
  background: linear-gradient(145deg, #e56d72, #ae4a67);
}

.equation-block:nth-child(3) {
  background: linear-gradient(145deg, #ef9645, #c87331);
}

.equation-block:nth-child(4) {
  background: linear-gradient(145deg, #ddb13c, #bd8324);
}

.equation-block:nth-child(5) {
  background: linear-gradient(145deg, #658dc8, #496cac);
}

.equation-dragging {
  cursor: grabbing;
  z-index: 100;
  transform: scale(1.08);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.44);
}

.equation-locked {
  cursor: default;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

@media (max-width: 800px) {
  .equation-slots {
    gap: 8px;
  }

  .equation-blocks {
    gap: 9px;
    bottom: 9%;
  }

  .equation-slot,
  .equation-block {
    width: clamp(48px, 7vw, 68px);
    height: clamp(48px, 7vw, 68px);
  }
}

/* =========================================================
   ESCENA 6 - INTERPRETACIÓN DE LA IGUALDAD
   ========================================================= */

.equation-meaning-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.equation-meaning-panel {
  position: absolute;
  left: 4%;
  top: 8%;
  width: 72%;
  min-height: 26%;
  padding: 2rem 2rem 1.6rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
}

.equation-meaning-question {
  margin-bottom: 1.2rem;
  color: #3a3550;
  font-size: clamp(1.2rem, 2.2vw, 2.3rem);
  font-weight: 700;
  line-height: 1.3;
}

.equation-meaning-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.equation-meaning-preview {
  position: absolute;
  left: 26%;
  bottom: 16%;
  width: 38%;
  padding: 1rem 1rem 1.2rem;
  border: 3px solid rgba(255, 212, 120, 0.45);
  border-radius: 18px;
  background: rgba(28, 34, 72, 0.62);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.equation-meaning-preview-title {
  margin-bottom: 0.8rem;
  text-align: center;
  color: #7ef4ff;
  font-size: clamp(1rem, 1.8vw, 1.8rem);
  font-weight: 900;
}

.equation-meaning-equation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.equation-meaning-token {
  min-width: 56px;
  height: 56px;
  padding: 0 0.7rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff7d6;
  font-size: clamp(1.3rem, 2.2vw, 2.3rem);
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.equation-meaning-token.token-x {
  background: linear-gradient(145deg, #d34b72, #973d70);
}

.equation-meaning-token.token-plus {
  background: linear-gradient(145deg, #c95d85, #934f92);
}

.equation-meaning-token.token-number {
  background: linear-gradient(145deg, #f08e8c, #d67a6f);
}

.equation-meaning-token.token-equal {
  background: linear-gradient(145deg, #ddb13c, #bd8324);
}

.equation-meaning-feedback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(14, 18, 36, 0.35);
  pointer-events: auto;
}

.equation-meaning-feedback-card {
  width: min(82%, 900px);
  max-width: 900px;
  min-height: 260px;
  padding: 1.1rem 1.2rem 1.3rem;
  border-radius: 24px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(
    180deg,
    rgba(37, 43, 85, 0.97),
    rgba(26, 31, 63, 0.96)
  );
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.35);
  color: #fff;
  position: relative;
}

.equation-meaning-feedback-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  font-size: clamp(1rem, 1.5vw, 1.45rem);
  font-weight: 800;
}

.equation-meaning-feedback-letter {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 1.45rem;
  font-weight: 900;
  color: #fff7d7;
  background: linear-gradient(145deg, #d35670, #9e3f60);
}

.equation-meaning-feedback-body {
  padding: 1.2rem 1.3rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.93);
  color: #2f2940;
  font-size: clamp(1rem, 1.5vw, 1.55rem);
  font-weight: 700;
  line-height: 1.45;
}

.equation-meaning-feedback-close {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #efeafc;
  font-size: 2rem;
  cursor: pointer;
}

.feedback-a .equation-meaning-feedback-letter {
  background: linear-gradient(145deg, #d35770, #9f3f60);
}

.feedback-b .equation-meaning-feedback-letter {
  background: linear-gradient(145deg, #72b650, #4f8a39);
}

.feedback-c .equation-meaning-feedback-letter {
  background: linear-gradient(145deg, #d5963b, #b46f1d);
}

@media (max-width: 900px) {
  .equation-meaning-panel {
    left: 3%;
    top: 8%;
    width: 75%;
    padding: 1rem 1rem 0.9rem;
    border-radius: 20px;
  }

  .equation-meaning-preview {
    left: 23%;
    bottom: 17%;
    width: 42%;
    padding: 0.7rem;
  }

  .equation-meaning-token {
    min-width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }

  .equation-meaning-feedback-card {
    width: min(90%, 760px);
    min-height: 220px;
    padding: 0.9rem 1rem 1rem;
  }
}

/* =========================================================
   ESCENA 8 - ENCONTRAR EL VALOR DE X
   ========================================================= */

.numeric-equation-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.numeric-equation-reference {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: min(58%, 720px);
  padding: 1rem 1.3rem;
  border: 3px solid rgba(255, 210, 100, 0.55);
  border-radius: 18px;
  background: rgba(29, 35, 73, 0.78);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.numeric-equation-title {
  margin-bottom: 0.8rem;
  text-align: center;
  color: #8df6dc;
  font-size: clamp(1rem, 1.7vw, 1.5rem);
  font-weight: 900;
}

.numeric-equation-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
}

.numeric-equation-token {
  min-width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  padding: 0 0.65rem;
  border-radius: 11px;
  color: #fff8db;
  font-size: clamp(1.5rem, 2.5vw, 2.4rem);
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.numeric-token-x {
  background: linear-gradient(145deg, #d34b72, #983d70);
}

.numeric-token-plus {
  background: linear-gradient(145deg, #cc6085, #984d8b);
}

.numeric-token-number {
  background: linear-gradient(145deg, #618fcd, #486aab);
}

.numeric-token-equal {
  background: linear-gradient(145deg, #dca73a, #bc8124);
}

.numeric-answer-panel {
  position: absolute;
  top: 51%;
  left: 50%;
  transform: translateX(-50%);
  width: min(46%, 560px);
  padding: 1.3rem;
  border-radius: 22px;
  background: rgba(255, 247, 224, 0.92);
  text-align: center;
  pointer-events: auto;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.numeric-answer-label {
  display: block;
  margin-bottom: 0.85rem;
  color: #493826;
  font-size: clamp(1.05rem, 1.8vw, 1.5rem);
  font-weight: 800;
}

.numeric-x-input {
  width: 170px;
  max-width: 60%;
  height: 58px;
  padding: 0 12px;
  border: 3px solid #815ba6;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: #34294a;
  font-size: 1.8rem;
  font-weight: 900;
  text-align: center;
}

.numeric-x-input:focus {
  border-color: #ba78f2;
  box-shadow: 0 0 0 4px rgba(174, 112, 231, 0.17);
}

.numeric-input-error {
  border-color: #db5656;
}

.numeric-verify-button {
  display: block;
  min-width: 190px;
  margin: 1rem auto 0;
  padding: 0.8rem 1.4rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #835ee7, #5936b8);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(70, 39, 149, 0.3);
}

.numeric-verify-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.numeric-substitution {
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.numeric-result-correct {
  background: rgba(83, 183, 98, 0.15);
  color: #28683a;
}

.numeric-result-wrong {
  background: rgba(220, 70, 70, 0.13);
  color: #883535;
}

@media (max-width: 900px) {
  .numeric-equation-reference {
    top: 31%;
    width: 58%;
    padding: 0.7rem;
  }

  .numeric-equation-token {
    min-width: 43px;
    height: 43px;
    font-size: 1.3rem;
  }

  .numeric-answer-panel {
    top: 52%;
    width: 48%;
    padding: 0.9rem;
  }

  .numeric-x-input {
    height: 46px;
    font-size: 1.4rem;
  }

  .numeric-verify-button {
    min-width: 150px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
}

/* =========================================================
   ESCENA 9 - PREGUNTA SOBRE VERIFICAR
   ========================================================= */

.simple-choice-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.simple-choice-panel {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: min(80%, 950px);
  padding: 1.6rem 1.8rem;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  pointer-events: auto;
}

.simple-choice-question {
  margin-bottom: 1.4rem;
  color: #36314a;
  font-size: clamp(1.25rem, 2.3vw, 2.2rem);
  font-weight: 800;
  text-align: center;
}

.simple-choice-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.simple-choice-option {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 0.8rem;
  min-height: 62px;
  padding: 0.55rem 0.8rem;
  border: 2px solid rgba(90, 112, 165, 0.3);
  border-radius: 14px;
  background: rgba(245, 246, 255, 0.95);
  color: #353047;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
}

.simple-choice-option:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(104, 142, 220, 0.8);
}

.simple-choice-letter {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(145deg, #d55767, #a63c55);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 900;
}

.simple-choice-option:nth-child(2) .simple-choice-letter {
  background: linear-gradient(145deg, #75b85d, #4f8d40);
}

.simple-choice-option:nth-child(3) .simple-choice-letter {
  background: linear-gradient(145deg, #9b70c6, #704a9d);
}

.simple-choice-text {
  font-size: clamp(0.95rem, 1.45vw, 1.25rem);
  font-weight: 700;
  line-height: 1.3;
}

.simple-choice-option.wrong-option {
  border-color: #d85a5a;
  animation: simpleChoiceWrong 0.35s ease;
}

.simple-choice-option.correct-option {
  border-color: #63b86e;
  background: rgba(221, 248, 224, 0.96);
}

@keyframes simpleChoiceWrong {
  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}

@media (max-width: 900px) {
  .simple-choice-panel {
    top: 23%;
    width: 78%;
    padding: 1rem;
  }

  .simple-choice-option {
    grid-template-columns: 45px 1fr;
    min-height: 50px;
  }

  .simple-choice-letter {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}
/* =========================================================
   ESCENA 10 - OPERACIÓN INVERSA
   ========================================================= */

.inverse-operation-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

/* ECUACIÓN ORIGINAL */

.inverse-equation-reference {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translateX(-50%);
  width: min(58%, 720px);
  padding: 1rem;
  border: 3px solid rgba(255, 205, 100, 0.55);
  border-radius: 18px;
  background: rgba(29, 34, 70, 0.78);
  text-align: center;
}

.inverse-equation-title {
  margin-bottom: 0.8rem;
  color: #ffe19a;
  font-size: clamp(0.95rem, 1.5vw, 1.3rem);
  font-weight: 800;
}

.inverse-equation-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.inverse-token {
  min-width: 58px;
  height: 58px;
  padding: 0 0.65rem;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff6d2;
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  font-weight: 900;
}

.inverse-x {
  background: #b84775;
}

.inverse-plus {
  background: #bf547e;
}

.inverse-number {
  background: #d96e69;
}

.inverse-equal {
  background: #c98d31;
}

.inverse-total {
  background: #527fc2;
}

/* PANEL */

.inverse-operation-panel {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translateX(-50%);
  width: min(58%, 700px);
  padding: 1.2rem;
  border-radius: 20px;
  background: rgba(255, 248, 229, 0.94);
  color: #443525;
  text-align: center;
  pointer-events: auto;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.inverse-operation-question {
  margin-bottom: 1rem;
  font-size: clamp(1rem, 1.7vw, 1.4rem);
  font-weight: 800;
}

.inverse-input-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.inverse-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.inverse-input-group label {
  font-weight: 800;
}

.inverse-operator-input,
.inverse-number-input {
  width: 110px;
  height: 54px;
  border: 3px solid #9067b5;
  border-radius: 10px;
  background: #fff;
  color: #34284a;
  font-size: 1.6rem;
  font-weight: 900;
  text-align: center;
  outline: none;
}

.inverse-test-button {
  display: block;
  min-width: 180px;
  margin: 1rem auto 0;
  padding: 0.75rem 1.3rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #855fe4, #5836b5);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

/* ECUACIÓN PROPUESTA */

.inverse-result {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 900;
}

.inverse-wrong {
  background: rgba(219, 73, 73, 0.13);
  color: #913737;
}

.inverse-correct {
  background: rgba(66, 183, 91, 0.16);
  color: #256e38;
}

.inverse-big-equal {
  font-size: 1.5em;
}

/* RESULTADO FINAL */

.inverse-final-result {
  margin-top: 1rem;
  padding: 0.9rem;
  border: 3px solid rgba(68, 182, 92, 0.42);
  border-radius: 14px;
  background: rgba(226, 255, 225, 0.72);
}

.inverse-simplification {
  color: #3a4938;
  font-size: clamp(1rem, 1.7vw, 1.45rem);
  font-weight: 800;
}

.inverse-arrow {
  margin: 0.35rem 0;
  color: #4c9e60;
  font-size: 1.8rem;
  font-weight: 900;
}

.inverse-x-result {
  color: #277239;
  font-size: clamp(1.5rem, 2.5vw, 2.3rem);
  font-weight: 900;
}

/* TABLET */

@media (max-width: 900px) {
  .inverse-equation-reference {
    top: 29%;
    width: 58%;
    padding: 0.7rem;
  }

  .inverse-token {
    min-width: 42px;
    height: 42px;
    font-size: 1.25rem;
  }

  .inverse-operation-panel {
    top: 47%;
    width: 60%;
    padding: 0.8rem;
  }

  .inverse-operator-input,
  .inverse-number-input {
    width: 85px;
    height: 42px;
    font-size: 1.25rem;
  }

  .inverse-test-button {
    min-width: 145px;
    padding: 0.55rem 1rem;
  }
}

/* =========================================================
   ESCENA 12 - MÁQUINA DE RÉPLICAS
   ========================================================= */

.replica-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

/* PRODUCCIÓN */

.replica-production {
  position: absolute;
  left: 8%;
  top: 8%;
  width: 40%;
  padding: 0.8rem 1rem;
  border: 3px solid rgba(138, 245, 222, 0.42);
  border-radius: 14px;
  background: rgba(18, 51, 55, 0.88);
  color: #f7df8a;
  text-align: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.replica-production-small {
  color: #b7e98f;
  font-size: clamp(0.85rem, 1.3vw, 1.2rem);
  font-weight: 800;
}

.replica-production-big {
  margin-top: 0.2rem;
  font-size: clamp(1.5rem, 2.7vw, 2.8rem);
  font-weight: 900;
}

/* TOTAL */

.replica-total {
  position: absolute;
  left: 24%;
  top: 59%;
  min-width: 290px;
  padding: 0.7rem 1.1rem;
  border: 3px solid rgba(118, 221, 255, 0.36);
  border-radius: 12px;
  background: rgba(19, 51, 60, 0.88);
  color: #ffe29a;
  text-align: center;
  font-size: clamp(1.2rem, 2vw, 1.9rem);
  font-weight: 900;
}

.replica-total strong {
  margin-left: 0.4rem;
  font-size: 1.25em;
}

/* BOTÓN RESPONDER */

.replica-answer-button {
  position: absolute;
  right: 8%;
  bottom: 12%;
  min-width: 180px;
  padding: 0.8rem 1.4rem;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(180deg, #6a72e5, #4546ad);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

/* PANEL DE PREGUNTA */

.replica-options-panel {
  position: absolute;
  right: 4%;
  bottom: 7%;
  width: min(42%, 560px);
  padding: 1rem;
  border: 3px solid rgba(113, 207, 255, 0.38);
  border-radius: 18px;
  background: rgba(21, 31, 58, 0.92);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
  pointer-events: auto;
}

.replica-question {
  margin-bottom: 0.8rem;
  color: #fff;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  font-weight: 800;
}

.replica-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@media (max-width: 900px) {
  .replica-production {
    left: 4%;
    width: 42%;
  }

  .replica-total {
    left: 19%;
    top: 61%;
    min-width: 220px;
  }

  .replica-options-panel {
    right: 2%;
    bottom: 4%;
    width: 44%;
  }

  .replica-answer-button {
    right: 5%;
    bottom: 8%;
  }
}

/* =========================================================
   ESCENA 13 - VALOR DE CADA CAJA
   ========================================================= */

.replica-numeric-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.replica-numeric-question {
  position: absolute;
  left: 7%;
  top: 25%;
  width: min(58%, 760px);
  padding: 1.5rem 1.7rem;
  border: 3px solid rgba(191, 220, 255, 0.55);
  border-radius: 26px;
  background: rgba(245, 248, 255, 0.94);
  color: #30344b;
  pointer-events: auto;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.replica-numeric-title {
  margin-bottom: 1.2rem;
  font-size: clamp(1.15rem, 2vw, 1.8rem);
  font-weight: 800;
  line-height: 1.4;
}

.replica-numeric-summary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding: 0.9rem;
  border-radius: 15px;
  background: rgba(35, 63, 82, 0.1);
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 800;
}

.replica-numeric-arrow {
  color: #4783b7;
  font-size: 1.7rem;
}

.replica-numeric-prompt {
  margin-bottom: 0.8rem;
  font-size: clamp(1rem, 1.55vw, 1.3rem);
  font-weight: 700;
  text-align: center;
}

.replica-numeric-input {
  display: block;
  width: 150px;
  height: 58px;
  margin: 0 auto;
  border: 3px solid #557ca9;
  border-radius: 11px;
  background: #fff;
  color: #29364f;
  font-size: 1.8rem;
  font-weight: 900;
  text-align: center;
  outline: none;
}

.replica-numeric-input:focus {
  border-color: #54a8dc;
  box-shadow: 0 0 0 4px rgba(69, 157, 213, 0.18);
}

.replica-numeric-error {
  border-color: #d95353;
}

.replica-numeric-button {
  display: block;
  min-width: 180px;
  margin: 1rem auto 0;
  padding: 0.75rem 1.2rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #5aa5df, #3973b2);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
}

.replica-numeric-result {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 13px;
  text-align: center;
  font-weight: 800;
  line-height: 1.5;
}

.replica-numeric-wrong {
  background: rgba(221, 77, 77, 0.14);
  color: #8c3434;
}

.replica-numeric-correct {
  background: rgba(63, 178, 91, 0.15);
  color: #286c39;
}

@media (max-width: 900px) {
  .replica-numeric-question {
    left: 5%;
    top: 28%;
    width: 62%;
    padding: 1rem;
  }

  .replica-numeric-input {
    width: 110px;
    height: 46px;
    font-size: 1.4rem;
  }

  .replica-numeric-button {
    min-width: 145px;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
  }
}

/* =========================================================
   ESCENA 15 - REPRESENTAR LA INCÓGNITA
   ========================================================= */

.symbol-assignment-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.symbol-assignment-panel {
  position: absolute;
  left: 7%;
  top: 24%;
  width: min(58%, 760px);
  padding: 1.5rem;
  border-radius: 26px;
  background: rgba(245, 248, 255, 0.94);
  color: #30344b;
  pointer-events: auto;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.symbol-assignment-title {
  margin-bottom: 1rem;
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

.symbol-assignment-input {
  display: block;
  width: 150px;
  height: 58px;
  margin: 0 auto;
  border: 3px solid #557ca9;
  border-radius: 11px;
  background: #fff;
  color: #29364f;
  font-size: 1.8rem;
  font-weight: 900;
  text-align: center;
  outline: none;
}

.symbol-assignment-button {
  display: block;
  min-width: 170px;
  margin: 1rem auto;
  padding: 0.75rem 1.2rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #5aa5df, #3973b2);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.symbol-boxes {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.2rem;
}

.symbol-box {
  width: 100px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(84, 159, 195, 0.55);
  border-radius: 12px;
  background: linear-gradient(145deg, #d5b77c, #b3945e);
  color: #332718;
  font-size: 2rem;
  font-weight: 900;
  text-transform: lowercase;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

.symbol-assignment-result {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 13px;
  text-align: center;
  font-weight: 800;
}

.symbol-result-correct {
  background: rgba(63, 178, 91, 0.15);
  color: #286c39;
}

.symbol-result-wrong {
  background: rgba(221, 77, 77, 0.14);
  color: #8c3434;
}

@media (max-width: 900px) {
  .symbol-assignment-panel {
    left: 5%;
    top: 27%;
    width: 62%;
    padding: 1rem;
  }

  .symbol-assignment-input {
    width: 110px;
    height: 46px;
    font-size: 1.4rem;
  }

  .symbol-box {
    width: 72px;
    height: 56px;
    font-size: 1.5rem;
  }
}

/* =========================================================
   ESCENA 16 - SUMA REPETIDA
   ========================================================= */

.repeated-quantity-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.repeated-question-panel {
  position: absolute;
  left: 6%;
  top: 24%;
  width: min(58%, 760px);
  padding: 1.4rem 1.6rem;
  border-radius: 24px;
  background: rgba(245, 248, 255, 0.95);
  color: #30344b;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.repeated-question {
  margin-bottom: 1.1rem;
  font-size: clamp(1.15rem, 2vw, 1.8rem);
  font-weight: 800;
  text-align: center;
}

.repeated-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

/* RESULTADO VISUAL */

.repeated-animation-panel {
  position: absolute;
  left: 17%;
  bottom: 8%;
  width: min(55%, 700px);
  padding: 1rem 1.4rem;
  border: 3px solid rgba(94, 223, 206, 0.55);
  border-radius: 18px;
  background: rgba(20, 42, 61, 0.91);
  color: #fff;
  text-align: center;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.repeated-times-indicator {
  margin-bottom: 0.7rem;
  color: #a4f0d5;
  font-size: clamp(0.9rem, 1.4vw, 1.2rem);
  font-weight: 800;
}

.repeated-expression {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  font-weight: 900;
}

.repeated-symbol {
  min-width: 58px;
  padding: 0.35rem 0.7rem;
  border-radius: 10px;
  background: rgba(193, 72, 117, 0.85);
  transition:
    transform 0.6s ease,
    box-shadow 0.4s ease,
    background 0.4s ease;
}

.repeated-symbol-highlight {
  background: #cf507c;
  box-shadow:
    0 0 12px rgba(255, 117, 166, 0.9),
    0 0 28px rgba(255, 117, 166, 0.55);
}

.repeated-sign {
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

/* COMPACTACIÓN */

.repeated-compacting .repeated-symbol {
  transform: scale(0.9);
}

.repeated-compacting .repeated-sign {
  opacity: 0.25;
  transform: scale(0.6);
}

.repeated-arrow {
  margin: 0.5rem 0;
  color: #ffd978;
  font-size: 2rem;
  font-weight: 900;
}

.repeated-compact-expression {
  opacity: 0;
  transform: scale(0.7);
  color: #ffe178;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  font-weight: 900;
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.repeated-compact-visible {
  opacity: 1;
  transform: scale(1);
}

@media (max-width: 900px) {
  .repeated-question-panel {
    left: 4%;
    top: 27%;
    width: 62%;
    padding: 1rem;
  }

  .repeated-animation-panel {
    left: 10%;
    bottom: 6%;
    width: 58%;
    padding: 0.7rem;
  }

  .repeated-expression {
    gap: 0.45rem;
  }

  .repeated-symbol {
    min-width: 42px;
    padding: 0.25rem 0.45rem;
  }
}

/* =========================================================
   ESCENA 17 - IGUALDAD DEL TALLER DE RÉPLICAS
   ========================================================= */

.replica-equation-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.replica-equation-board {
  position: absolute;
  left: 6%;
  top: 23%;
  width: min(63%, 820px);
  padding: 1.4rem 1.6rem;
  border: 3px solid rgba(123, 211, 222, 0.45);
  border-radius: 24px;
  background: rgba(22, 45, 61, 0.93);
  color: #fff;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.32);
  pointer-events: auto;
}

.replica-equation-title {
  color: #fff0b3;
  font-size: clamp(1.15rem, 2vw, 1.75rem);
  font-weight: 900;
  text-align: center;
}

.replica-equation-subtitle {
  margin: 0.45rem 0 1.2rem;
  color: #d9eff4;
  font-size: clamp(0.85rem, 1.3vw, 1.05rem);
  text-align: center;
}

/* ESPACIOS */

.replica-equation-slots {
  display: grid;
  grid-template-columns: 1fr 0.65fr 1fr;
  gap: 0.8rem;
  width: min(90%, 600px);
  margin: 0 auto 1.4rem;
}

.replica-equation-slot {
  min-height: 86px;
  display: grid;
  place-items: center;
  border: 3px dashed rgba(255, 226, 142, 0.8);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

/* BANDEJA */

.replica-equation-tray {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  min-height: 92px;
}

/* PIEZAS */

.replica-equation-piece {
  min-width: 92px;
  height: 68px;
  padding: 0 1rem;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.23);
  border-radius: 13px;
  background: linear-gradient(145deg, #d25178, #994570);
  color: #fff8d5;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 900;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

.replica-equation-piece[data-piece-type="equal"] {
  background: linear-gradient(145deg, #dba73a, #b77a23);
}

.replica-equation-piece[data-piece-type="total"] {
  background: linear-gradient(145deg, #618dcc, #456baa);
}

.replica-equation-dragging {
  z-index: 100;
  cursor: grabbing;
  transform: scale(1.08);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
}

/* RESULTADO */

.replica-equation-status {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.1);
  text-align: center;
  line-height: 1.5;
}

.replica-equation-registered {
  color: #8bf0aa;
  font-weight: 900;
}

.replica-equation-final {
  margin-top: 0.4rem;
  color: #ffe27d;
  font-size: clamp(1.5rem, 2.7vw, 2.5rem);
  font-weight: 900;
}

@media (max-width: 900px) {
  .replica-equation-board {
    left: 4%;
    top: 27%;
    width: 66%;
    padding: 0.9rem;
  }

  .replica-equation-slot {
    min-height: 58px;
  }

  .replica-equation-piece {
    min-width: 65px;
    height: 48px;
    padding: 0 0.65rem;
    font-size: 1.25rem;
  }
}

/* =========================================================
   ESCENA 18 - RESOLVER LA IGUALDAD
   ========================================================= */

.replica-equation-numeric-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.replica-equation-numeric-panel {
  position: absolute;
  left: 7%;
  top: 24%;
  width: min(58%, 760px);
  padding: 1.5rem;
  border-radius: 26px;
  background: rgba(245, 248, 255, 0.95);
  color: #30344b;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.replica-equation-numeric-title {
  margin-bottom: 1rem;
  font-size: clamp(1.15rem, 2vw, 1.8rem);
  font-weight: 900;
  text-align: center;
}

.replica-equation-fixed {
  width: fit-content;
  min-width: 260px;
  margin: 0 auto 1.3rem;
  padding: 0.9rem 1.4rem;
  border-radius: 15px;
  background: rgba(26, 53, 73, 0.92);
  color: #ffe17a;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  font-weight: 900;
  text-align: center;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.replica-equation-numeric-question {
  margin-bottom: 0.8rem;
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  font-weight: 800;
  text-align: center;
}

.replica-equation-answer-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
}

.replica-equation-symbol,
.replica-equation-equal {
  font-size: 2rem;
  font-weight: 900;
}

.replica-equation-numeric-input {
  width: 130px;
  height: 56px;
  border: 3px solid #557ca9;
  border-radius: 11px;
  background: #fff;
  color: #29364f;
  font-size: 1.8rem;
  font-weight: 900;
  text-align: center;
  outline: none;
}

.replica-equation-numeric-input:focus {
  border-color: #54a8dc;
  box-shadow: 0 0 0 4px rgba(69, 157, 213, 0.18);
}

.replica-equation-numeric-button {
  display: block;
  min-width: 180px;
  margin: 1rem auto 0;
  padding: 0.75rem 1.2rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #5aa5df, #3973b2);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
}

.replica-equation-numeric-result {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 13px;
  text-align: center;
  font-weight: 800;
}

.replica-equation-result-wrong {
  background: rgba(221, 77, 77, 0.14);
  color: #8c3434;
}

.replica-equation-result-correct {
  background: rgba(63, 178, 91, 0.15);
  color: #286c39;
}

@media (max-width: 900px) {
  .replica-equation-numeric-panel {
    left: 5%;
    top: 27%;
    width: 62%;
    padding: 1rem;
  }

  .replica-equation-fixed {
    min-width: 200px;
    padding: 0.65rem 1rem;
  }

  .replica-equation-numeric-input {
    width: 100px;
    height: 46px;
    font-size: 1.4rem;
  }
}

/* =========================================================
   ESCENA 19 - DESPEJE DE LA VARIABLE
   ========================================================= */

.replica-inverse-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.replica-inverse-panel {
  position: absolute;
  left: 7%;
  top: 23%;
  width: min(58%, 760px);
  padding: 1.5rem;
  border-radius: 26px;
  background: rgba(245, 248, 255, 0.95);
  color: #30344b;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.replica-inverse-title {
  margin-bottom: 1rem;
  font-size: clamp(1.15rem, 2vw, 1.8rem);
  font-weight: 900;
  text-align: center;
}

.replica-inverse-equation {
  width: fit-content;
  min-width: 260px;
  margin: 0 auto 1.2rem;
  padding: 0.8rem 1.3rem;
  border-radius: 15px;
  background: rgba(26, 53, 73, 0.92);
  color: #ffe17a;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  font-weight: 900;
  text-align: center;
}

.replica-inverse-question {
  margin-bottom: 1rem;
  text-align: center;
  font-size: clamp(1rem, 1.55vw, 1.3rem);
  font-weight: 800;
}

.replica-inverse-inputs {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.replica-inverse-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.replica-inverse-group label {
  font-weight: 800;
}

.replica-inverse-operator,
.replica-inverse-number {
  width: 110px;
  height: 52px;
  border: 3px solid #557ca9;
  border-radius: 11px;
  background: #fff;
  color: #29364f;
  font-size: 1.6rem;
  font-weight: 900;
  text-align: center;
  outline: none;
}

.replica-inverse-button {
  display: block;
  min-width: 170px;
  margin: 1rem auto 0;
  padding: 0.75rem 1.2rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #5aa5df, #3973b2);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
}

.replica-inverse-operation-result {
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 13px;
  background: rgba(35, 63, 82, 0.1);
  text-align: center;
  font-weight: 800;
}

.replica-inverse-proposed {
  margin-top: 0.45rem;
  font-size: 1.25rem;
}

.replica-inverse-correct {
  background: rgba(63, 178, 91, 0.15);
  color: #286c39;
}

.replica-inverse-final {
  margin-top: 1rem;
  padding: 0.9rem;
  border-radius: 14px;
  background: rgba(26, 53, 73, 0.92);
  color: #fff;
  text-align: center;
}

.replica-inverse-step {
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 800;
}

.replica-inverse-arrow {
  margin: 0.35rem 0;
  color: #ffe17a;
  font-size: 1.8rem;
}

.replica-inverse-answer {
  color: #8bf0aa;
  font-size: clamp(1.5rem, 2.7vw, 2.4rem);
  font-weight: 900;
}

@media (max-width: 900px) {
  .replica-inverse-panel {
    left: 5%;
    top: 27%;
    width: 62%;
    padding: 1rem;
  }

  .replica-inverse-operator,
  .replica-inverse-number {
    width: 85px;
    height: 44px;
    font-size: 1.3rem;
  }
}

/* =========================================================
   ESCENA 22 - TRADUCCIÓN DEL ENUNCIADO
   ========================================================= */

.phrase-translation-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.phrase-translation-board {
  position: absolute;
  left: 6%;
  top: 22%;
  width: min(66%, 860px);
  padding: 1.5rem 1.7rem;
  border: 3px solid rgba(218, 174, 82, 0.55);
  border-radius: 24px;
  background: rgba(28, 25, 32, 0.88);
  color: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

.phrase-translation-title {
  color: #ffe2a0;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-weight: 900;
  text-align: center;
}

.phrase-translation-instruction {
  margin: 0.4rem 0 1.2rem;
  color: #e9e4dc;
  text-align: center;
}

.phrase-translation-rows {
  display: grid;
  gap: 0.9rem;
}

.phrase-translation-row {
  display: grid;
  grid-template-columns: 1fr 40px 150px 100px;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.phrase-translation-text {
  font-size: clamp(0.95rem, 1.45vw, 1.2rem);
  font-weight: 800;
}

.phrase-translation-arrow {
  color: #ffd36d;
  font-size: 1.5rem;
  font-weight: 900;
  text-align: center;
}

.phrase-translation-input {
  width: 100%;
  height: 48px;
  border: 3px solid #b48a47;
  border-radius: 10px;
  background: #fffaf0;
  color: #302717;
  font-size: 1.3rem;
  font-weight: 900;
  text-align: center;
  outline: none;
}

.phrase-translation-input:focus {
  border-color: #e5b951;
  box-shadow: 0 0 0 4px rgba(222, 174, 72, 0.18);
}

.phrase-translation-check {
  height: 45px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #d5a642, #9b6b25);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.phrase-row-wrong {
  border-color: rgba(221, 77, 77, 0.8);
}

.phrase-row-correct {
  border-color: rgba(89, 207, 118, 0.85);
  background: rgba(63, 178, 91, 0.12);
}

.phrase-translation-complete {
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 13px;
  background: rgba(64, 178, 91, 0.16);
  color: #9af0ae;
  font-size: 1.2rem;
  font-weight: 900;
  text-align: center;
}

@media (max-width: 900px) {
  .phrase-translation-board {
    left: 4%;
    top: 25%;
    width: 70%;
    padding: 1rem;
  }

  .phrase-translation-row {
    grid-template-columns: 1fr 25px 105px 75px;
    gap: 0.35rem;
    padding: 0.5rem;
  }

  .phrase-translation-input {
    height: 40px;
    font-size: 1.05rem;
  }

  .phrase-translation-check {
    height: 40px;
    font-size: 0.75rem;
  }
}

/* =========================================================
   ESCENA 23 - CONSTRUIR ECUACIÓN DESDE LAS PISTAS
   ========================================================= */

.phrase-equation-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.phrase-equation-board {
  position: absolute;
  left: 6%;
  top: 23%;
  width: min(66%, 850px);
  padding: 1.4rem 1.6rem;
  border: 3px solid rgba(218, 174, 82, 0.55);
  border-radius: 24px;
  background: rgba(28, 25, 32, 0.9);
  color: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

.phrase-equation-title {
  color: #ffe2a0;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-weight: 900;
  text-align: center;
}

.phrase-equation-instruction {
  margin: 0.4rem 0 1.2rem;
  color: #e9e4dc;
  text-align: center;
}

.phrase-equation-slots {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.8rem;
  width: min(92%, 650px);
  margin: 0 auto 1.3rem;
}

.phrase-equation-slot {
  min-height: 82px;
  display: grid;
  place-items: center;
  border: 3px dashed rgba(255, 220, 132, 0.82);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.phrase-equation-tray {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  min-height: 90px;
}

.phrase-equation-piece {
  min-width: 110px;
  height: 64px;
  padding: 0 1rem;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 13px;
  background: linear-gradient(145deg, #c65b74, #8f3d62);
  color: #fff8d5;
  font-size: clamp(1.3rem, 2.3vw, 2rem);
  font-weight: 900;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

.phrase-equation-piece[data-piece-type="subtract"] {
  background: linear-gradient(145deg, #d9953b, #aa6924);
}

.phrase-equation-piece[data-piece-type="total"] {
  background: linear-gradient(145deg, #5f8fc9, #4569a3);
}

.phrase-equation-dragging {
  z-index: 100;
  cursor: grabbing;
  transform: scale(1.07);
}

.phrase-equation-result {
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 13px;
  background: rgba(63, 178, 91, 0.14);
  text-align: center;
}

.phrase-equation-registered {
  color: #91efaa;
  font-weight: 900;
}

.phrase-equation-final {
  margin-top: 0.4rem;
  color: #ffe17a;
  font-size: clamp(1.5rem, 2.6vw, 2.4rem);
  font-weight: 900;
}

@media (max-width: 900px) {
  .phrase-equation-board {
    left: 4%;
    top: 26%;
    width: 70%;
    padding: 1rem;
  }

  .phrase-equation-slot {
    min-height: 58px;
  }

  .phrase-equation-piece {
    min-width: 76px;
    height: 48px;
    padding: 0 0.6rem;
    font-size: 1.15rem;
  }
}

/* =========================================================
   ESCENA 24 - RESOLUCIÓN ALGEBRAICA EN DOS PASOS
   ========================================================= */

.two-step-equation-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.two-step-equation-panel {
  position: absolute;
  left: 6%;
  top: 21%;
  width: min(64%, 840px);
  padding: 1.5rem 1.7rem;
  border: 3px solid rgba(218, 174, 82, 0.55);
  border-radius: 24px;
  background: rgba(28, 25, 32, 0.9);
  color: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

.two-step-equation-title {
  color: #ffe2a0;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-weight: 900;
  text-align: center;
}

.two-step-equation-display {
  width: fit-content;
  min-width: 270px;
  margin: 1rem auto;
  padding: 0.9rem 1.4rem;
  border-radius: 14px;
  background: rgba(45, 36, 24, 0.88);
  color: #ffe17a;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  font-weight: 900;
  text-align: center;
  box-shadow: inset 0 0 0 2px rgba(255, 208, 96, 0.16);
}

.two-step-equation-question {
  margin-bottom: 1rem;
  color: #f3eee5;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 800;
  text-align: center;
}

.two-step-equation-inputs {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.two-step-equation-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.two-step-equation-group label {
  color: #f0dcae;
  font-weight: 800;
}

.two-step-equation-operator,
.two-step-equation-number {
  width: 110px;
  height: 52px;
  border: 3px solid #b48a47;
  border-radius: 10px;
  background: #fffaf0;
  color: #302717;
  font-size: 1.6rem;
  font-weight: 900;
  text-align: center;
  outline: none;
}

.two-step-equation-button {
  display: block;
  min-width: 170px;
  margin: 1rem auto 0;
  padding: 0.75rem 1.2rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #d5a642, #9b6b25);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
}

.two-step-equation-work {
  margin-top: 1rem;
  padding: 0.9rem;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  text-align: center;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 800;
}

.two-step-arrow {
  margin: 0.3rem 0;
  color: #ffd86d;
  font-size: 1.6rem;
}

.two-step-simplified {
  color: #9debb2;
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  font-weight: 900;
}

.two-step-final-value {
  color: #ffe17a;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  font-weight: 900;
}

@media (max-width: 900px) {
  .two-step-equation-panel {
    left: 4%;
    top: 24%;
    width: 70%;
    padding: 1rem;
  }

  .two-step-equation-operator,
  .two-step-equation-number {
    width: 85px;
    height: 44px;
    font-size: 1.3rem;
  }
}

/* =========================================================
   ESCENA 25 - IDENTIFICAR DIVISIÓN
   ========================================================= */

.division-structure-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

/* BARRA SUPERIOR */

.division-equation-bar {
  position: absolute;
  left: 50%;
  top: 10%;
  transform: translateX(-50%);
  width: min(82%, 1050px);
  min-height: 82px;
  padding: 0.8rem 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
  border: 3px solid rgba(197, 149, 64, 0.7);
  border-radius: 12px;
  background: rgba(219, 190, 130, 0.92);
  color: #3c3121;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.division-equation-label {
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  font-weight: 800;
}

.division-equation-slots {
  display: flex;
  gap: 0.6rem;
}

.division-top-slot {
  width: 62px;
  height: 54px;
  border: 3px solid rgba(72, 57, 38, 0.75);
  border-radius: 5px;
  background: rgba(255, 247, 220, 0.65);
}

/* PREGUNTA */

.division-question-board {
  position: absolute;
  left: 7%;
  top: 27%;
  width: min(62%, 800px);
  padding: 1.4rem 1.6rem;
  border: 3px solid rgba(218, 174, 82, 0.55);
  border-radius: 24px;
  background: rgba(28, 25, 32, 0.9);
  color: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

.division-statement {
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 13px;
  background: rgba(255, 225, 140, 0.12);
  color: #ffe29a;
  font-size: clamp(1.1rem, 1.8vw, 1.55rem);
  font-weight: 900;
  text-align: center;
}

.division-question {
  margin-bottom: 1rem;
  color: #f2eee6;
  font-size: clamp(1rem, 1.55vw, 1.3rem);
  font-weight: 800;
  line-height: 1.4;
}

.division-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.division-constructor-unlocked {
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 12px;
  background: rgba(62, 180, 93, 0.15);
  color: #9af0ad;
  font-size: 1.1rem;
  font-weight: 900;
  text-align: center;
}

@media (max-width: 900px) {
  .division-equation-bar {
    top: 8%;
    width: 90%;
    min-height: 62px;
    padding: 0.5rem 0.7rem;
    gap: 0.6rem;
  }

  .division-top-slot {
    width: 42px;
    height: 38px;
  }

  .division-question-board {
    left: 4%;
    top: 25%;
    width: 69%;
    padding: 1rem;
  }
}

/* =========================================================
   ESCENA 26 - CONSTRUCTOR GUIADO DE ECUACIÓN
   ========================================================= */

.guided-division-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.guided-division-board {
  position: absolute;
  left: 6%;
  top: 20%;
  width: min(66%, 860px);
  padding: 1.4rem 1.6rem;
  border: 3px solid rgba(218, 174, 82, 0.55);
  border-radius: 24px;
  background: rgba(28, 25, 32, 0.9);
  color: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}

.guided-division-statement {
  margin-bottom: 0.8rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: rgba(255, 224, 139, 0.12);
  color: #ffe09b;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 900;
  text-align: center;
}

.guided-division-label {
  margin-bottom: 0.5rem;
  color: #e8e0d1;
  font-weight: 800;
  text-align: center;
}

/* ECUACIÓN */

.guided-division-slots {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}

.guided-division-slot {
  width: 78px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(218, 180, 100, 0.45);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff5cc;
  font-size: 1.7rem;
  font-weight: 900;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.guided-division-slot.active-slot {
  border-color: #ffd46b;
  box-shadow:
    0 0 0 3px rgba(255, 212, 107, 0.13),
    0 0 18px rgba(255, 212, 107, 0.25);
}

.guided-division-slot.division-slot-filled {
  border-color: rgba(89, 207, 118, 0.85);
  background: rgba(61, 156, 85, 0.18);
}

/* PREGUNTA */

.guided-division-question {
  margin: 0.8rem 0;
  color: #f5f1e9;
  font-size: clamp(1rem, 1.55vw, 1.3rem);
  font-weight: 800;
  text-align: center;
  line-height: 1.4;
}

/* PIEZAS */

.guided-division-pieces {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-height: 72px;
}

.guided-division-piece {
  min-width: 82px;
  min-height: 56px;
  padding: 0.6rem 1rem;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: linear-gradient(145deg, #c15c79, #8d405f);
  color: #fff8d8;
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.12s ease,
    filter 0.12s ease;
}

.guided-division-piece:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

/* FINAL */

.guided-division-status {
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 13px;
  background: rgba(61, 174, 89, 0.14);
  text-align: center;
}

.guided-division-complete-title {
  color: #95efaa;
  font-weight: 900;
}

.guided-division-final-equation {
  margin-top: 0.35rem;
  color: #ffe17a;
  font-size: clamp(1.5rem, 2.7vw, 2.4rem);
  font-weight: 900;
}

@media (max-width: 900px) {
  .guided-division-board {
    left: 4%;
    top: 23%;
    width: 70%;
    padding: 1rem;
  }

  .guided-division-slot {
    width: 53px;
    height: 46px;
    font-size: 1.25rem;
  }

  .guided-division-piece {
    min-width: 62px;
    min-height: 44px;
    padding: 0.4rem 0.7rem;
    font-size: 1rem;
  }
}

.division-inverse-board {
  max-width: 760px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.division-registered {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: #1f7a1f;
}

.division-main-equation {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 18px;
}

.division-help-text {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 18px;
  text-align: center;
}

.division-panel-label {
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.division-operator-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.division-operator-select,
.division-number-input {
  min-width: 120px;
  height: 44px;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid #bbb;
  padding: 0 12px;
}

.division-apply-btn,
.division-verify-btn {
  height: 46px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.division-step-work,
.division-verify-work {
  margin-top: 18px;
  padding: 16px;
  background: #f7f4ff;
  border-radius: 14px;
  text-align: center;
}

.division-step-line,
.division-step-result {
  font-size: 1.5rem;
  font-weight: 700;
}

.division-step-arrow {
  font-size: 1.5rem;
  margin: 8px 0;
}

.division-step-result.success {
  color: #1f7a1f;
}

.final-equation-challenge-scene {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.final-challenge-panel {
  position: absolute;
  left: 6%;
  top: 18%;
  width: min(66%, 860px);
  padding: 1.4rem 1.6rem;
  border: 3px solid rgba(218, 174, 82, 0.55);
  border-radius: 24px;
  background: rgba(28, 25, 32, 0.9);
  color: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}

.final-challenge-statement {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: rgba(255, 224, 139, 0.12);
  color: #ffe09b;
  font-size: 1.25rem;
  font-weight: 900;
  text-align: center;
}

.final-challenge-question,
.final-solver-question {
  margin: 1rem 0;
  text-align: center;
  font-weight: 800;
}

.final-equation-input {
  display: block;
  width: min(90%, 600px);
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: 10px;
  border: 3px solid #b48a47;
  background: #fffaf0;
  color: #302717;
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
}

.final-challenge-button,
.final-verify-button {
  display: block;
  margin: 0.8rem auto;
  padding: 0.75rem 1.4rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #d5a642, #9b6b25);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.final-equation-registered {
  margin: 1rem 0;
  text-align: center;
}

.final-registered-label {
  color: #9af0ad;
  font-weight: 900;
}

.final-current-equation {
  margin-top: 0.5rem;
  color: #ffe17a;
  font-size: 2rem;
  font-weight: 900;
}

.final-operation-row {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

.final-operator-select,
.final-number-input {
  height: 46px;
  min-width: 120px;
  border-radius: 10px;
  border: 2px solid #b48a47;
  padding: 0 0.7rem;
  font-size: 1.1rem;
}

.final-work,
.final-verification {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.final-work-line,
.final-work-result {
  font-size: 1.45rem;
  font-weight: 900;
}

.final-work-result {
  color: #9af0ad;
}

.final-work-arrow {
  margin: 0.3rem 0;
  font-size: 1.6rem;
}

.final-complete {
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: 12px;
  background: rgba(65, 180, 90, 0.15);
  color: #9af0ad;
  text-align: center;
  font-weight: 900;
}
.feedback-layer {
  position: absolute;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.floating-feedback-overlay {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  background: rgba(14, 18, 36, 0.28);
  pointer-events: auto;
}

.floating-feedback-card {
  position: relative;
  width: min(84%, 680px);
  padding: 1.4rem 3rem 1.4rem 1.5rem;
  border-radius: 22px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.floating-feedback-card.is-correct {
  background: linear-gradient(145deg, #e7f8ec, #ccefd7);
  border: 3px solid #3ea863;
  color: #164928;
}

.floating-feedback-card.is-wrong {
  background: linear-gradient(145deg, #fdecec, #fad4d4);
  border: 3px solid #e07a7a;
  color: #6b1d1d;
}

.floating-feedback-icon {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #ffffff;
}

.floating-feedback-icon svg {
  width: 24px;
  height: 24px;
}

.floating-feedback-card.is-correct .floating-feedback-icon {
  background: #2e9a54;
}

.floating-feedback-card.is-wrong .floating-feedback-icon {
  background: #d95c5c;
}

.floating-feedback-text {
  margin: 0;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  font-weight: 700;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.floating-feedback-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.floating-feedback-close:hover {
  background: rgba(0, 0, 0, 0.15);
}


/* Posición opcional del diálogo, independiente de la posición de Ana.
   Sin data-position se conserva la distribución anterior. */
.speech-bubble[data-position] {
  width: min(64%, 650px);
  min-height: 0;
  padding: 12px 16px;
  line-height: 1.35;
}
.speech-bubble[data-position="left"] {
  left: 3%;
  right: auto;
  transform: none;
}
.speech-bubble[data-position="center"] {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}
.speech-bubble[data-position="right"] {
  left: auto;
  /* Reservar espacio para el botón de audio. */
  right: calc(3% + 64px);
  transform: none;
}
.speech-bubble[data-position="center"]::after {
  left: 50%;
  transform: translateX(-50%);
}
.speech-bubble[data-position="right"]::after {
  left: auto;
  right: 48px;
}
@media (max-width: 900px), (max-height: 550px) {
  .speech-bubble[data-position] {
    padding: 8px 12px;
    font-size: clamp(0.76rem, 1.5vw, 0.95rem);
    line-height: 1.25;
  }
  .speech-bubble[data-position="right"] {
    right: calc(3% + 54px);
  }
  .speech-bubble[data-position]::after {
    bottom: -15px;
    border-width: 7px;
  }
}
