:root {
  --white: #ffffff;
  --ink: #090909;
  --soft: #edf0f1;
  --blue: #008eb8;
  --green: #69aa2d;
  --yellow: #ffed00;
  --red: #d62716;
  --purple: #c89bc8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
}

body {
  min-width: 320px;
  background: var(--white);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
}

button,
a {
  cursor: pointer;
}

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

.experience,
.scene {
  width: 100%;
  height: 100%;
}

.scene {
  isolation: isolate;
  overflow: hidden;
}

/* HUD */
.hud {
  position: fixed;
  z-index: 200;
  inset: 0 0 auto;
  height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
  pointer-events: none;
}

.hud a,
.score-panel {
  pointer-events: auto;
}

.hud-home,
.hud-wiki {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  text-decoration: none;
}

.hud-wiki {
  justify-self: end;
}

.score-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  background: rgba(255,255,255,.92);
  opacity: 0;
  transform: translateY(-18px);
  transition: opacity .4s ease, transform .4s ease;
}

.score-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.score-label,
.score-panel strong {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

.score-slots {
  display: flex;
  gap: 6px;
}

.score-slot {
  position: relative;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  background: #fff;
  clip-path: polygon(28% 0,72% 0,100% 25%,100% 75%,72% 100%,28% 100%,0 75%,0 25%);
  transition: background-color .3s ease, transform .35s cubic-bezier(.2,.9,.2,1.2);
}

.score-slot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
}

.score-slot.is-filled {
  background: var(--green);
  transform: rotate(18deg) scale(1.08);
}

.score-slot.is-filled::after {
  background: #fff;
}

/* CURSOR */
@media (pointer: fine) {
  body,
  button,
  a {
    cursor: none;
  }
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  z-index: 20000;
  left: 0;
  top: 0;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.cursor-dot.is-visible,
.cursor-ring.is-visible {
  opacity: 1;
}

.cursor-dot {
  width: 7px;
  height: 7px;
  background: var(--blue);
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1.5px solid rgba(0,142,184,.8);
  transition: width .2s ease, height .2s ease, border-color .2s ease, background-color .2s ease;
}

.cursor-ring.is-hovering {
  width: 58px;
  height: 58px;
  border-color: var(--yellow);
  background: rgba(255,237,0,.12);
}

/* INTRO */
.intro,
.route-stage,
.red-transition,
.blue-game,
.green-feedback,
.win-transition {
  position: absolute;
  inset: 0;
}

.intro-copy {
  position: absolute;
}

.intro-copy p {
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .28em;
}

.intro-copy h1 {
  font-weight: 900;
}

/* ESTADO CON TUERCAS */
.route-stage {
  transition: opacity .5s ease, transform .5s ease;
}

.route-stage.is-muted {
  opacity: .16;
  pointer-events: none;
  transform: scale(.98);
}

.nut-ring {
  position: absolute;
  inset: 0;
}

.ring-piece {
  position: absolute;
  padding: 0;
  background: transparent;
  color: var(--ink);
  opacity: 0;
}

.ring-piece svg {
  display: block;
  width: 100%;
  height: auto;
}

.ring-piece.is-ready {
  opacity: 1;
}

.ring-piece:not(:disabled):hover,
.ring-piece:not(:disabled):focus-visible {
  z-index: 10;
  outline: none;
}

.ring-piece.type-red:hover,
.ring-piece.type-red:focus-visible { color: var(--red); }

.ring-piece.type-blue:hover,
.ring-piece.type-blue:focus-visible { color: var(--blue); }

.ring-piece.type-green:hover,
.ring-piece.type-green:focus-visible { color: var(--green); }

.ring-piece.is-collected {
  color: rgba(105,170,45,.18);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.72) rotate(var(--piece-rotation));
}

.route-help {
  position: absolute;
  z-index: 12;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.route-help p,
.route-help strong {
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .22em;
}

.route-help p {
  margin-bottom: 7px;
  color: #777;
}

/* ROJO */
.red-transition {
  opacity: 0;
  pointer-events: none;
}

.red-transition.is-visible {
  opacity: 1;
}

.red-transition p {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 8vh;
  transform: translateX(-50%);
  color: var(--red);
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 900;
  letter-spacing: .28em;
  opacity: 0;
}

@keyframes redText { to { opacity: 1; } }

/* AZUL */
.blue-game {
  z-index: 90;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
}

.blue-game.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.blue-title,
.blue-counter {
  position: absolute;
  z-index: 10;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .24em;
}

.blue-wheel {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  aspect-ratio: 1;
  background: transparent;
  transform: translate(-50%, -50%);
}

.blue-game.is-orbiting .blue-wheel {
  animation: blueWheelSpin 6.5s linear infinite;
}

.blue-orbit-piece {
  position: absolute;
  width: clamp(66px, 7vw, 112px);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.2) rotate(-25deg);
  transition:
    left .82s cubic-bezier(.2,.85,.2,1),
    top .82s cubic-bezier(.2,.85,.2,1),
    opacity .55s ease,
    transform .82s cubic-bezier(.2,.85,.2,1);
}

.blue-orbit-piece svg {
  display: block;
  width: 100%;
  animation: bluePieceSpin 2.4s linear infinite reverse;
}

.blue-orbit-piece:nth-child(1) { left: 50%; top: 5%; }
.blue-orbit-piece:nth-child(2) { left: 88%; top: 27%; }
.blue-orbit-piece:nth-child(3) { left: 88%; top: 73%; }
.blue-orbit-piece:nth-child(4) { left: 50%; top: 95%; }
.blue-orbit-piece:nth-child(5) { left: 12%; top: 73%; }
.blue-orbit-piece:nth-child(6) { left: 12%; top: 27%; }

.blue-game.is-visible .blue-orbit-piece {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0);
}

.blue-game.is-merging .blue-wheel {
  animation: none;
  pointer-events: none;
}

.blue-game.is-merging .blue-orbit-piece {
  left: 50%;
  top: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.08) rotate(180deg);
}

.blue-break-piece {
  position: absolute;
  z-index: 7;
  top: 50%;
  left: 50%;
  aspect-ratio: 1;
  background: transparent;
  color: var(--blue);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.16) rotate(-35deg);
}

.blue-break-piece svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.blue-game.is-piece-ready .blue-break-piece {
  pointer-events: auto;
}

.blue-fragment {
  transform-box: fill-box;
  transform-origin: center;
}

.blue-fragment.is-gone {
  animation: fragmentAway .46s forwards cubic-bezier(.2,.8,.2,1);
}

.blue-core {
  pointer-events: none;
}

.blue-game.is-complete .blue-break-piece {
  pointer-events: none;
  animation: blueFinish .6s forwards ease;
}

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

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

@keyframes bluePieceGrow {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.16) rotate(-35deg); }
  72% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(4deg); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
}

@keyframes fragmentAway {
  to {
    opacity: 0;
    transform: translate(var(--fragment-x), var(--fragment-y)) rotate(var(--fragment-rotate)) scale(.3);
  }
}

@keyframes blueFinish {
  to { opacity: 0; transform: translate(-50%, -50%) scale(1.45) rotate(22deg); }
}

/* VERDE */
.green-feedback {
  z-index: 85;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.84);
  opacity: 0;
  pointer-events: none;
}

.green-feedback.is-visible {
  animation: greenFeedback 1.15s forwards ease;
}

.green-rings {
  position: absolute;
  width: min(58vw, 680px);
  aspect-ratio: 1;
  border: 3px solid var(--green);
  border-radius: 50%;
  opacity: 0;
}

.green-feedback.is-visible .green-rings {
  animation: greenRings 1s forwards ease-out;
}

.green-nut {
  width: clamp(130px, 17vw, 250px);
  color: var(--green);
  opacity: 0;
}

.green-nut svg {
  display: block;
  width: 100%;
}

.green-feedback.is-visible .green-nut {
  animation: greenNut 1s forwards cubic-bezier(.2,.9,.2,1.1);
}

.green-feedback p {
  position: absolute;
  bottom: 12vh;
  color: var(--green);
  font-size: clamp(1.2rem, 2.4vw, 2.1rem);
  font-weight: 900;
  letter-spacing: .24em;
  opacity: 0;
}

.green-feedback.is-visible p {
  animation: greenText .55s .18s forwards ease;
}

.flying-point {
  position: fixed;
  z-index: 5000;
  width: 34px;
  height: 34px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 900;
  clip-path: polygon(28% 0,72% 0,100% 25%,100% 75%,72% 100%,28% 100%,0 75%,0 25%);
  pointer-events: none;
}

@keyframes greenFeedback {
  0% { opacity: 0; }
  18%,75% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes greenRings {
  0% { opacity: .9; transform: scale(.12); }
  100% { opacity: 0; transform: scale(1.45); }
}

@keyframes greenNut {
  0% { opacity: 0; transform: scale(.16) rotate(-28deg); }
  42% { opacity: 1; transform: scale(1.05) rotate(0); }
  100% { opacity: 0; transform: scale(2.2) rotate(55deg); }
}

@keyframes greenText { to { opacity: 1; } }

/* GANANDO */
.win-transition {
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: var(--yellow);
  opacity: 0;
  pointer-events: none;
  clip-path: circle(0 at 50% 50%);
  text-align: center;
}

.win-transition.is-visible {
  pointer-events: auto;
  animation: winReveal 1.1s forwards cubic-bezier(.76,0,.24,1);
}

.win-emblem {
  position: relative;
  width: clamp(150px, 22vw, 330px);
  aspect-ratio: 122.48 / 118.66;
  color: #fff;
  opacity: 0;
  transform: scale(.2) rotate(-30deg);
}

.win-emblem > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  shape-rendering: geometricPrecision;
}

.win-transition.is-visible .win-emblem {
  animation: winEmblem .9s .45s forwards cubic-bezier(.2,.9,.2,1.12);
}

.win-transition p {
  margin-top: 26px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .28em;
  opacity: 0;
}

.win-transition h2 {
  margin-top: 8px;
  font-size: clamp(4rem, 13vw, 12rem);
  font-weight: 900;
  letter-spacing: -.07em;
  line-height: .85;
  opacity: 0;
  transform: translateY(30px);
}

.win-transition.is-visible p,
.win-transition.is-visible h2 {
  animation: winText .7s .85s forwards ease;
}

.win-actions {
  display: flex;
  gap: 12px;
  margin-top: 38px;
  opacity: 0;
  transform: translateY(20px);
}

.win-transition.is-visible .win-actions {
  animation: winText .65s 1.25s forwards ease;
}

.win-actions button,
.win-actions a {
  min-width: 150px;
  padding: 14px 18px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-decoration: none;
}

.win-actions button:hover,
.win-actions a:hover,
.win-actions button:focus-visible,
.win-actions a:focus-visible {
  background: var(--ink);
  color: var(--yellow);
}

@keyframes winReveal {
  0% { opacity: 1; clip-path: circle(0 at 50% 50%); }
  100% { opacity: 1; clip-path: circle(78% at 50% 50%); }
}

@keyframes winEmblem {
  0% { opacity: 0; transform: scale(.2) rotate(-30deg); }
  70% { opacity: 1; transform: scale(1.08) rotate(5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes winText {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .hud {
    height: 64px;
    padding: 0 14px;
  }

  .hud-home,
  .hud-wiki {
    font-size: 9px;
    letter-spacing: .1em;
  }

  .score-panel {
    gap: 6px;
    padding: 7px 8px;
  }

  .score-label {
    display: none;
  }

  .score-slot {
    width: 18px;
    height: 18px;
  }

  .score-slot::after {
    inset: 6px;
  }

  .blue-wheel {
    width: 82vw;
  }

  .blue-orbit-piece {
    width: 58px;
  }

  .blue-break-piece {
    width: min(72vw, 300px);
  }

  .win-actions {
    flex-direction: column;
    width: min(100%, 320px);
  }

  .win-actions button,
  .win-actions a {
    width: 100%;
  }
}

@media (pointer: coarse) {
  .cursor-dot,
  .cursor-ring {
    display: none;
  }

  .ring-piece.type-red::after,
  .ring-piece.type-blue::after,
  .ring-piece.type-green::after {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    content: "";
    border-radius: 50%;
    transform: translate(-50%, -50%);
  }

  .ring-piece.type-red::after { background: var(--red); }
  .ring-piece.type-blue::after { background: var(--blue); }
  .ring-piece.type-green::after { background: var(--green); }
}

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

html,
body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: none;
}

body {
  scrollbar-color: var(--blue) rgba(9, 9, 9, .08);
  scrollbar-width: thin;
}

.experience {
  position: relative;
}

.scene {
  width: 100%;
  perspective: 1200px;
}

.scene.route-active::before {
  opacity: .12;
  transform: translate3d(-8vw, 7vh, 0) scale(.75);
}

.scene.route-active::after {
  opacity: .32;
  transform: translate3d(7vw, -5vh, 0) scale(1.2);
}

/* INTRO CON PEÓN 3D */
.intro {
  z-index: 20;
  opacity: 1;
  transform: none;
  transition: opacity .58s ease;
}

.intro.is-hidden {
  opacity: 0;
  transform: none;
  pointer-events: none;
}

.pawn-3d {
  position: absolute;
  left: 50%;
  transform-origin: center;
}

#pawnCanvas {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
}

.pawn-fallback {
  position: absolute;
  z-index: 2;
  align-items: center;
  flex-direction: column;
  justify-content: flex-end;
  filter: drop-shadow(0 20px 22px rgba(72, 45, 78, .2));
}

.pawn-3d.has-webgl .pawn-fallback {
  display: none;
}

.intro-copy {
  transition: opacity .2s linear, transform .2s linear;
  will-change: opacity, transform;
}

.intro-copy p {
  color: var(--purple);
}

.intro-scroll {
  position: absolute;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 9px;
  color: var(--ink);
  transition: opacity .2s linear;
}

.intro-scroll span {
  position: relative;
  width: 27px;
  height: 46px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.intro-scroll span::after {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 9px;
  content: "";
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-50%);
  animation: introScrollCue 1.35s ease-in-out infinite;
}

.intro-scroll strong {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .22em;
}

@keyframes introScrollCue {
  0% { opacity: 0; transform: translate(-50%, 0); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 18px); }
}

/* ESCENARIO DE TUERCAS: RECORRIDO ABIERTO */

.route-stage {
  z-index: 30;
}

.route-stage::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
}

.route-stage.is-visible::before {
  opacity: 1;
  transform: scale(1);
}

.nut-ring {
  z-index: 6;
}

.ring-piece {
  transform: translate(-50%, -50%) scale(0) rotate(var(--piece-rotation));
}

.ring-piece svg {
  animation: routePieceFloat 3.2s var(--float-delay, 0s) ease-in-out infinite;
  filter: drop-shadow(0 14px 14px rgba(9,9,9,.12));
}

.ring-piece.is-ready {
  transform: translate(-50%, -50%) scale(1) rotate(var(--piece-rotation));
}

.ring-piece:not(:disabled):hover,
.ring-piece:not(:disabled):focus-visible {
  transform: translate(-50%, -50%) scale(1.22) rotate(calc(var(--piece-rotation) + 18deg));
  filter: brightness(1.05) drop-shadow(0 20px 18px rgba(9,9,9,.18));
}

@keyframes routePieceFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0); }
  50% { transform: translate3d(0, -8px, 0) rotate(4deg); }
}

.route-help {
  bottom: 4.5vh;
  border: 1px solid rgba(9,9,9,.1);
  border-radius: 999px;
  box-shadow: 0 18px 45px rgba(9,9,9,.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.route-help strong {
  color: var(--ink);
}

/* Los cuatro efectos permanecen a pantalla completa para reforzar la inmersión. */
.red-transition,
.blue-game,
.green-feedback,
.win-transition {
  position: absolute;
  inset: 0;
}

.red-transition.is-visible,
.blue-game.is-visible,
.green-feedback.is-visible,
.win-transition.is-visible {
  isolation: isolate;
}

.win-transition.is-visible {
  box-shadow: inset 0 0 120px rgba(255,255,255,.35);
}

@media (max-width: 760px) {

  .scene {
    min-height: 560px;
  }

  .route-help {
    bottom: 3vh;
    border-radius: 20px;
  }

  .route-help p,
  .route-help strong {
    font-size: 8px;
    letter-spacing: .15em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .experience {
    height: 140svh;
  }

  .ring-piece svg,
  .intro-scroll span::after {
    animation: none !important;
  }
}

.pawn-3d {
  width: clamp(155px, 15vw, 255px);
  height: clamp(285px, 29vw, 470px);
  transform: translate3d(-50%, -50%, 0) scale(1);
  transition: opacity .12s linear;
  will-change: transform, opacity;
  filter: drop-shadow(0 30px 34px rgba(72, 45, 78, .24));
}

.pawn-fallback {
  inset: 4% 17%;
  display: grid;
  place-items: center;
}

.pawn-fallback img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 20px 22px rgba(72, 45, 78, .2));
}

/* Anula las piezas antiguas del fallback clásico. */

.intro-copy,
.intro-scroll,
.route-stage {
  will-change: transform, opacity;
}

.route-stage.is-visible .ring-piece.is-ready {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(var(--piece-rotation));
}

@media (max-width: 760px) {
  .experience {
    height: 185svh;
    min-height: 1120px;
  }

  .pawn-3d {
    width: 128px;
    height: 270px;
  }
}
html {
  scroll-behavior: auto;
  overscroll-behavior-y: none;
}

.pawn-3d,
.intro-copy,
.intro-scroll,
.route-stage {
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

/* Las transformaciones las interpola JavaScript; se eliminan transiciones
   adicionales que podían producir tirones al arrastrar la barra. */
.pawn-3d,
.intro-copy,
.intro-scroll,
.route-stage {
  transition-property: opacity;
}


/* ═══════════════════════════════════════════════════════════════
   TRANSICIÓN CINEMATOGRÁFICA — NO DEPENDE DE LA BARRA DE SCROLL
═══════════════════════════════════════════════════════════════ */
html,
body {
  overflow: hidden;
  overscroll-behavior: none;
}

.experience {
  width: 100%;
  height: 100svh;
  min-height: 620px;
}

.scene {
  position: relative;
  top: auto;
  height: 100%;
  min-height: 620px;
}

.pawn-3d,
.intro-copy,
.intro-scroll,
.route-stage {
  transition: none;
}

/* La ruta existe detrás desde el comienzo, pero permanece fuera de foco. */
.route-stage {
  opacity: 0;
  transform: translate3d(0, 7vh, -120px) scale(1.12);
  filter: blur(18px);
  pointer-events: none;
}

.route-stage.is-cinematic {
  display: block;
  pointer-events: none;
  animation: cinematicRouteIn 1.75s .28s both cubic-bezier(.18,.72,.18,1);
}

.route-stage.is-visible {
  opacity: 1;
  filter: none;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

.scene.journey-playing .intro-copy {
  animation: cinematicCopyOut .92s .08s both cubic-bezier(.55,.02,.28,1);
}

.scene.journey-playing .intro-scroll {
  animation: cinematicHintOut .38s both ease;
}

.scene.journey-playing .pawn-3d {
  animation: cinematicPawnJourney 2.05s both cubic-bezier(.22,.76,.16,1);
}

.scene.journey-playing::before {
  animation: cinematicGlowPurple 2s both ease;
}

.scene.journey-playing::after {
  animation: cinematicGlowBlue 2s both ease;
}

.scene.journey-playing .ring-piece.is-ready {
  animation: cinematicPieceReveal .88s var(--piece-delay) both cubic-bezier(.18,.88,.22,1.22);
}

@keyframes cinematicCopyOut {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translate3d(-12vw, -4vh, 0);
    filter: blur(7px);
  }
}

@keyframes cinematicHintOut {
  to {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
  }
}

@keyframes cinematicPawnJourney {
  0% {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0) scale(1) rotate(0deg);
    filter: drop-shadow(0 30px 34px rgba(72,45,78,.24)) blur(0);
  }
  55% {
    opacity: 1;
    transform: translate3d(-50%, calc(-50% + 27vh), 90px) scale(1.14) rotate(-1.5deg);
    filter: drop-shadow(0 38px 42px rgba(72,45,78,.28)) blur(0);
  }
  72% {
    opacity: 1;
    transform: translate3d(-50%, calc(-50% + 27vh), 110px) scale(1.08) rotate(1deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(-50%, calc(-50% + 27vh), 240px) scale(1.72) rotate(4deg);
    filter: drop-shadow(0 46px 50px rgba(72,45,78,.08)) blur(10px);
  }
}

@keyframes cinematicRouteIn {
  0% {
    opacity: 0;
    transform: translate3d(0, 7vh, -120px) scale(1.12);
    filter: blur(18px);
  }
  62% {
    opacity: .82;
    transform: translate3d(0, 0, 0) scale(.985);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

@keyframes cinematicPieceReveal {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.18) rotate(calc(var(--piece-rotation) - 45deg));
    filter: blur(10px);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1) rotate(calc(var(--piece-rotation) + 6deg));
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(var(--piece-rotation));
    filter: blur(0);
  }
}

@keyframes cinematicGlowPurple {
  0% { opacity: .28; transform: scale(1); }
  50% { opacity: .48; transform: translate3d(-6vw, 5vh, 0) scale(1.2); }
  100% { opacity: .12; transform: translate3d(-10vw, 8vh, 0) scale(.72); }
}

@keyframes cinematicGlowBlue {
  0% { opacity: .28; transform: scale(1); }
  52% { opacity: .5; transform: translate3d(5vw, -4vh, 0) scale(1.3); }
  100% { opacity: .32; transform: translate3d(7vw, -5vh, 0) scale(1.2); }
}

@media (max-width: 760px) {
  .experience,
  .scene {
    height: 100svh;
    min-height: 560px;
  }

  @keyframes cinematicPawnJourney {
    0% {
      opacity: 1;
      transform: translate3d(-50%, -50%, 0) scale(1);
      filter: blur(0);
    }
    58% {
      opacity: 1;
      transform: translate3d(-50%, calc(-50% + 28vh), 70px) scale(1.08) rotate(-1deg);
      filter: blur(0);
    }
    100% {
      opacity: 0;
      transform: translate3d(-50%, calc(-50% + 28vh), 180px) scale(1.55) rotate(3deg);
      filter: blur(8px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene.journey-playing .intro-copy,
  .scene.journey-playing .intro-scroll,
  .scene.journey-playing .pawn-3d,
  .route-stage.is-cinematic,
  .scene.journey-playing .ring-piece.is-ready {
    animation-duration: .01ms !important;
  }
}

/* Se reutiliza la capa que ya recibe el movimiento suave del cursor. */

/* Luz difusa sobre las láminas. */

/* Lámina base. */

/* Canto claro de cada lámina; no crea líneas externas decorativas. */

/* AMARILLO */

/* ROJO */

/* AZUL */

/* VERDE */

/* SUPERPOSICIONES */

/* Se mantienen los mismos apoyos de contraste de la ruta. */

.route-help {
  background: rgba(255,255,255,.72);
}

/* Los antiguos halos de la escena permanecen desactivados. */

/* Al entrar a la ruta, el fondo conserva el comportamiento anterior. */
.blue-wheel,
.blue-break-piece {
  transition:
    opacity .42s ease,
    transform .55s cubic-bezier(.2,.8,.2,1),
    filter .42s ease;
}

.blue-align-stage {
  position: absolute;
  z-index: 12;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity .45s ease,
    transform .68s cubic-bezier(.18,.85,.22,1.08);
}

.blue-game.is-aligning .blue-wheel,
.blue-game.is-aligning .blue-break-piece {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.72) rotate(12deg);
  filter: blur(8px);
}

/* Marco rectangular observado en el video. */
.blue-align-board {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Semicírculos fijos que indican dónde debe conectarse el camino. */
.blue-align-board::before,
.blue-align-board::after {
  position: absolute;
  z-index: 8;
  top: 50%;
  aspect-ratio: 1;
  content: "";
  border-radius: 50%;
  pointer-events: none;
  transform: translateY(-50%);
}

.blue-align-board::before {
  left: calc(clamp(56px, 8vw, 96px) / -2);
}

.blue-align-board::after {
  right: calc(clamp(56px, 8vw, 96px) / -2);
}

/* La tira tiene siete casillas alternadas. Solo tres se ven dentro del marco. */

/* Líneas horizontales suaves para conservar la lectura de casillas. */

.blue-align-help {
  position: absolute;
  left: 50%;
  width: 100%;
  transform: translateX(-50%);
  text-align: center;
  font-weight: 900;
}

@media (max-width: 760px) {

  .blue-align-board {
    inset: 0 0 38px;
  }

  .blue-align-board::before,
  .blue-align-board::after {
    width: 58px;
  }

  .blue-align-board::before {
    left: -29px;
  }

  .blue-align-board::after {
    right: -29px;
  }
}
.blue-game {
  overflow: hidden;
}

.blue-game::before,
.blue-game::after {
  position: absolute;
  content: "";
  inset: 0;
  pointer-events: none;
}

.blue-game::before {
  opacity: .58;
  background:
    linear-gradient(rgba(0,142,184,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,142,184,.045) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at center, rgba(0,0,0,1) 28%, rgba(0,0,0,.15) 72%, transparent 100%);
  animation: blueGridFloat 18s linear infinite;
}

.blue-game::after {
  inset: 12% 20%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,142,184,.22), rgba(0,142,184,0) 68%);
  filter: blur(22px);
  opacity: .7;
  animation: blueHaloPulse 4.8s ease-in-out infinite;
}

.blue-title,
.blue-counter {
  width: min(92vw, 780px);
  text-shadow: 0 1px 0 rgba(255,255,255,.85), 0 10px 18px rgba(0,77,102,.10);
}

.blue-wheel {
  border: 0;
  cursor: pointer;
  isolation: isolate;
}

.blue-wheel::before,
.blue-wheel::after {
  position: absolute;
  content: "";
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}

.blue-wheel::before {
  aspect-ratio: 1;
}

.blue-wheel::after {
  aspect-ratio: 1;
  box-shadow: 0 0 24px rgba(0,142,184,.16);
}

.blue-orbit-piece svg {
  overflow: visible;
  filter: drop-shadow(0 0 14px rgba(0,142,184,.12));
}

.blue-orbit-piece::before {
  position: absolute;
  content: "";
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.8), rgba(255,255,255,0));
  opacity: .65;
  pointer-events: none;
}

.blue-break-piece {
  border: 0;
  cursor: pointer;
}

.blue-break-piece::before {
  position: absolute;
  content: "";
  left: 50%;
  top: 50%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.blue-break-piece:hover {
  transform: translate(-50%, -50%) scale(1.02);
}

.blue-align-board {
  border-color: #13404f;
}

.blue-align-help {
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}

@keyframes blueGridFloat {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(38px, 38px, 0); }
}

@keyframes blueHaloPulse {
  0%,100% { transform: scale(1); opacity: .55; }
  50% { transform: scale(1.08); opacity: .82; }
}

@media (max-width: 760px) {
  .blue-game::before {
    background-size: 28px 28px;
  }

  .blue-title,
  .blue-counter {
    width: min(94vw, 92vw);
  }

  .blue-wheel::before {
    box-shadow: 0 0 0 10px rgba(0,142,184,.05), inset 0 0 0 6px rgba(255,255,255,.42);
  }
}

/* Títulos limpios, con una pequeña señal de desafío. */
.blue-title {
  padding: 0 0 12px;
  font-size: clamp(11px, 1vw, 14px);
  letter-spacing: .2em;
}

.blue-title::after {
  display: block;
  width: 48px;
  height: 3px;
  margin: 12px auto 0;
  content: "";
  border-radius: 999px;
  transform: scaleX(.65);
  animation: blueCleanLine 2.1s ease-in-out infinite;
}

.blue-counter {
  width: min(88vw, 720px);
  font-size: clamp(10px, .95vw, 13px);
  letter-spacing: .16em;
}

/* Órbita: limpia, pero con movimiento de fichas más juguetón. */
.blue-wheel {
  width: clamp(305px, 43vw, 545px);
  filter: drop-shadow(0 24px 36px rgba(0,92,120,.12));
}

.blue-wheel::before {
  width: 70%;
  border: 1.5px dashed rgba(0,142,184,.26);
}

.blue-wheel::after {
  width: 18%;
  background:
    radial-gradient(circle,
      #fff 0 31%,
      rgba(0,142,184,.14) 32% 58%,
      rgba(0,142,184,0) 59% 100%);
}

.blue-orbit-piece {
  filter: drop-shadow(0 10px 14px rgba(0,92,120,.13));
}

.blue-game.is-orbiting .blue-orbit-piece:nth-child(odd) {
  animation: blueCleanTokenHop 1.9s ease-in-out infinite;
}

.blue-game.is-orbiting .blue-orbit-piece:nth-child(even) {
  animation: blueCleanTokenHop 1.9s .28s ease-in-out infinite reverse;
}

/* Pieza central: conserva el pequeño rebote sin bordes pesados. */
.blue-break-piece {
  width: clamp(200px, 26vw, 370px);
  filter: drop-shadow(0 24px 34px rgba(0,92,120,.15));
}

.blue-break-piece::before {
  width: 78%;
  background: radial-gradient(circle, rgba(0,142,184,.16), transparent 70%);
  filter: blur(13px);
}

.blue-fragment {
  fill: #00a5cf;
  stroke: rgba(255,255,255,.7);
  stroke-width: 2px;
  filter: drop-shadow(0 7px 10px rgba(0,86,111,.12));
}

.blue-fragment:nth-child(2) { fill: #0097bf; }
.blue-fragment:nth-child(3) { fill: #16b1d8; }
.blue-fragment:nth-child(4) { fill: #0788ad; }

.blue-core {
  stroke-width: 3px;
}

.blue-game.is-piece-ready .blue-break-piece {
  animation:
    bluePieceGrow .72s forwards cubic-bezier(.2,.9,.2,1.12),
    blueCleanPieceIdle 2.7s .8s ease-in-out infinite;
}

.blue-break-piece.is-hit svg {
  animation: blueCleanHit .32s ease;
}

/* Tablero de alineación: composición limpia, con profundidad suave. */

.blue-align-board::before,
.blue-align-board::after {
  width: clamp(58px, 8vw, 92px);
  border: 0;
}

/* Éxito con rebote corto, sin convertirlo en un tablero caricaturesco. */

@keyframes blueCleanLine {
  0%,100% { transform: scaleX(.55); opacity: .68; }
  50% { transform: scaleX(1); opacity: 1; }
}

@keyframes blueCleanTokenHop {
  0%,100% { translate: 0 0; scale: 1; }
  50% { translate: 0 -7px; scale: 1.045; }
}

@keyframes blueCleanPieceIdle {
  0%,100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}

@keyframes blueCleanHit {
  0%,100% { transform: scale(1) rotate(0); }
  38% { transform: scale(.94) rotate(-3deg); }
  72% { transform: scale(1.035) rotate(2deg); }
}

@media (max-width: 760px) {
  .blue-title {
    padding-bottom: 9px;
  }

  .blue-align-board {
    border-radius: 15px;
  }
}


/* ═══════════════════════════════════════════════════════════════
   MINI JUEGO ROJO — TRAZA EL CAMINO
   Se activa después de la transición roja existente.
═══════════════════════════════════════════════════════════════ */
.red-game {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, 2.8vh, 28px);
  overflow: hidden;
  padding: 84px 4vw 34px;
  background:
    radial-gradient(circle at 50% 47%, rgba(214,39,22,.055), transparent 34%),
    rgba(255,255,255,.98);
  pointer-events: none;
}

.red-game::before {
  position: absolute;
  inset: -18%;
  content: "";
  opacity: .26;
  background:
    radial-gradient(circle at 18% 24%, rgba(214,39,22,.16), transparent 16%),
    radial-gradient(circle at 82% 76%, rgba(214,39,22,.11), transparent 18%);
  filter: blur(40px);
  pointer-events: none;
}

.red-game.is-visible {
  pointer-events: auto;
}

.red-game-heading {
  position: relative;
  z-index: 4;
  width: min(92vw, 980px);
  text-align: center;
}

.red-game-heading span,
.red-game-heading h2,
.red-game-status {
  font-weight: 900;
  letter-spacing: .18em;
}

.red-game-heading span {
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 9px;
}

.red-game-heading h2 {
  color: var(--ink);
  font-size: clamp(13px, 1.35vw, 18px);
  line-height: 1.35;
}

.red-maze {
  position: relative;
  z-index: 3;
  width: min(92vw, 1040px);
  height: min(62vh, 570px);
  min-height: 330px;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(rgba(214,39,22,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214,39,22,.022) 1px, transparent 1px),
    #fff;
  background-size: 32px 32px;
  box-shadow: 0 24px 58px rgba(65,10,6,.10);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.red-maze::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(105,170,45,.06), transparent 11%, transparent 89%, rgba(105,170,45,.06));
  pointer-events: none;
}

.red-maze-lines,
.red-obstacle-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.red-maze-lines {
  z-index: 5;
  overflow: visible;
  pointer-events: none;
}

.red-trace-glow,
.red-trace-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.red-trace-glow {
  stroke: rgba(105,170,45,.18);
  stroke-width: 13;
}

.red-trace-path {
  stroke: var(--green);
  stroke-width: 4.5;
}

.red-obstacle-layer {
  z-index: 3;
  pointer-events: none;
}

.red-maze-obstacle {
  position: absolute;
  left: var(--obstacle-x);
  top: var(--obstacle-y);
  width: clamp(46px, var(--obstacle-size), 168px);
  aspect-ratio: 122.48 / 118.66;
  color: var(--red);
  transform-origin: center;
  filter: drop-shadow(0 9px 11px rgba(87,11,5,.10));
}

.red-maze-obstacle svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.red-route-marker {
  position: absolute;
  z-index: 8;
  top: 50%;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 7px;
  color: var(--green);
  transform: translateY(-50%);
  pointer-events: none;
}

.red-start-marker { left: 2.3%; }
.red-goal-marker { right: 2.3%; }

.red-route-marker i {
  display: block;
  width: clamp(30px, 3.8vw, 44px);
  aspect-ratio: 1;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  box-shadow: 0 0 0 7px rgba(105,170,45,.055);
}

.red-route-marker strong {
  color: rgba(9,9,9,.52);
  font-size: 7px;
  font-style: normal;
  letter-spacing: .15em;
}

.red-game-status {
  position: relative;
  z-index: 4;
  min-height: 16px;
  color: rgba(9,9,9,.62);
  text-align: center;
  font-size: 9px;
}

.red-maze.is-drawing .red-start-marker i {
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(105,170,45,.10);
}

.red-maze.is-failed {
  animation: redMazeFail .48s linear;
}

.red-maze.is-failed .red-trace-glow {
  stroke: rgba(214,39,22,.18);
}

.red-maze.is-failed .red-trace-path {
  stroke: var(--red);
}

.red-game.is-failed .red-game-status {
  color: var(--red);
}

.red-game.is-won .red-maze {
  border-color: rgba(105,170,45,.78);
  box-shadow:
    0 0 0 4px rgba(105,170,45,.08),
    0 24px 58px rgba(36,80,7,.10);
  animation: redMazeWin .82s both cubic-bezier(.2,.8,.2,1);
}

.red-game.is-won .red-goal-marker i {
  background: var(--green);
  animation: redGoalPulse .72s ease;
}

.red-game.is-won .red-game-status {
  color: var(--green);
}

@keyframes redMazeFail {
  0%,100% { transform: translateX(0); }
  18% { transform: translateX(-8px); }
  36% { transform: translateX(7px); }
  54% { transform: translateX(-5px); }
  72% { transform: translateX(4px); }
}

@keyframes redMazeWin {
  0%,100% { transform: scale(1); }
  42% { transform: scale(1.018); }
  70% { transform: scale(.996); }
}

@keyframes redGoalPulse {
  0% { transform: scale(.72); }
  55% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

@media (max-width: 760px) {
  .red-game {
    gap: 16px;
    padding: 72px 14px 28px;
  }

  .red-maze {
    width: min(96vw, 620px);
    height: min(58vh, 470px);
    min-height: 310px;
    border-radius: 16px;
    background-size: 24px 24px;
  }

  .red-game-heading h2 {
    font-size: 11px;
    letter-spacing: .13em;
  }

  .red-maze-obstacle {
    width: clamp(42px, var(--obstacle-size), 118px);
  }

  .red-start-marker { left: 1.2%; }
  .red-goal-marker { right: 1.2%; }

  .red-route-marker i {
    width: 29px;
  }

  .red-route-marker strong {
    display: none;
  }

  .red-game-status {
    font-size: 7px;
    letter-spacing: .12em;
  }
}


/* Ajuste del marcador para cinco piezas verdes. */
@media (max-width: 480px) {
  .score-panel {
    gap: 5px;
    padding: 6px 7px;
  }

  .score-slots {
    gap: 3px;
  }

  .score-slot {
    width: 15px;
    height: 15px;
  }

  .score-slot::after {
    inset: 5px;
  }

  .score-panel strong {
    font-size: 8px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   CORRECCIONES INTEGRADAS
   1. Piezas verdes recolectadas sin borde negro.
   2. Fundido cruzado suave entre la transición roja y el minijuego.
═══════════════════════════════════════════════════════════════ */

/* Piezas del marcador ya completadas: sin contorno negro. */
.score-slot.is-filled {
  border-color: transparent;
  box-shadow: none;
}

/* La pieza del recorrido ya utilizada no conserva contorno ni sombra. */
.ring-piece.is-collected,
.ring-piece.is-collected:focus,
.ring-piece.is-collected:focus-visible {
  border: 0;
  outline: 0;
  box-shadow: none;
  filter: none;
}

.ring-piece.is-collected svg {
  filter: none;
}

/* La pantalla roja se mantiene por encima mientras termina de desvanecerse. */
.red-transition {
  z-index: 94;
  transition:
    opacity .58s cubic-bezier(.4, 0, .2, 1),
    filter .58s cubic-bezier(.4, 0, .2, 1);
  will-change: opacity, filter;
}

.red-transition.is-visible {
  filter: blur(0);
}

.red-transition:not(.is-visible) {
  filter: blur(7px);
}

.red-transition p {
  transition:
    opacity .38s ease,
    transform .48s cubic-bezier(.4, 0, .2, 1);
}

.red-transition:not(.is-visible) p {
  opacity: 0;
  transform: translate(-50%, 12px);
}

/* El minijuego aparece debajo mediante fundido y acercamiento suave. */
.red-game {
  z-index: 92;
  opacity: 0;
  filter: blur(8px);
  transform: scale(.985);
  will-change: opacity, filter, transform;
}

.red-game.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

/* Entrada escalonada del título, tablero e instrucción. */
.red-game-heading,
.red-maze,
.red-game-status {
  opacity: 0;
  transform: translateY(12px);
}

.red-game.is-visible .red-game-heading,
.red-game.is-visible .red-maze,
.red-game.is-visible .red-game-status {
  opacity: 1;
  transform: translateY(0);
}

.red-game.is-visible .red-game-heading {
  transition-delay: .08s;
}

.red-game.is-visible .red-maze {
  transition-delay: .14s;
}

.red-game.is-visible .red-game-status {
  transition-delay: .20s;
}

/* Borde rojo suave del tablero. */
.red-maze {
  border: 1.5px solid rgba(214, 39, 22, .34);
}

@media (prefers-reduced-motion: reduce) {
  .red-transition,
  .red-transition p,
  .red-game,
  .red-game-heading,
  .red-maze,
  .red-game-status {
    transition-duration: .01ms !important;
  }
}

/* 1. Fondo inicial coordinado con el lenguaje de la landing:
   una sola tonalidad amarilla, mucho más tenue y sin mezcla multicolor. */

/* 2. Mini juego azul con color plano, sin reflejos, brillos ni degradados. */

.blue-game::before,
.blue-game::after,
.blue-wheel::after,
.blue-orbit-piece::before,
.blue-break-piece::before {
  display: none;
}

.blue-wheel,
.blue-orbit-piece,
.blue-orbit-piece svg,
.blue-break-piece,
.blue-align-stage {
  filter: none;
}

.blue-wheel::before {
  border-color: rgba(0,142,184,.34);
  box-shadow: none;
  background: transparent;
}

.blue-orbit-piece {
  color: var(--blue);
}

.blue-fragment,
.blue-fragment:nth-child(2),
.blue-fragment:nth-child(3),
.blue-fragment:nth-child(4) {
  fill: var(--blue);
  stroke: none;
  filter: none;
}

.blue-core {
  fill: #ffffff;
  stroke: none;
}

.blue-align-board::before,
.blue-align-board::after {
  background: var(--blue);
  box-shadow: none;
}

.blue-title,
.blue-counter,
.blue-align-help {
  text-shadow: none;
}

/* 3. Marcador de piezas con esquinas redondeadas. */
.score-panel {
  border-radius: 16px;
}

/* 4. Piezas rojas del laberinto más grandes sin alterar posiciones ni lógica. */
.red-maze-obstacle {
  transform:
    translate(-50%, -50%)
    rotate(var(--obstacle-rotation))
    scale(1.18);
}

@media (max-width: 760px) {
  .red-maze-obstacle {
    transform:
      translate(-50%, -50%)
      rotate(var(--obstacle-rotation))
      scale(1.12);
  }
}

/* Éxito azul: conserva la señal verde, también como relleno plano. */

/* 1. Fondo inicial completamente plano: sin cuadrados ni láminas. */
.scene {
  background: #fff9d6;
}

/* 2. Contador de piezas con borde amarillo. */
.score-panel {
  border-color: #ffdd00;
}

/* 3. Minijuego rojo sin halos ni sombras verdes. */
.red-maze::after {
  display: none;
}

.red-route-marker i,
.red-maze.is-drawing .red-start-marker i,
.red-game.is-won .red-maze,
.red-game.is-won .red-goal-marker i {
  box-shadow: none;
}

.red-trace-glow {
  display: none;
}

/* 4. Nombre ENRÚTATE en amarillo. */
.hud-home {
  color: #ffdd00;
}


/* ═══════════════════════════════════════════════════════════════
   EXPERIENCIA ACTUALIZADA — CARGA, SONIDO Y TRANSICIÓN ROJA
   Se mantienen intactos el recorrido y la lógica de los minijuegos.
═══════════════════════════════════════════════════════════════ */

/* Pantalla inicial de carga. El clic permite habilitar audio en navegadores. */
.loading-screen {
  position: fixed;
  z-index: 15000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  background: #ffdd00;
  opacity: 1;
  visibility: visible;
  transition:
    opacity .55s ease,
    visibility .55s ease;
}

.loading-screen::before {
  position: absolute;
  inset: 0;
  content: "";
  background: #ffffff;
  clip-path: circle(0 at 50% 50%);
  pointer-events: none;
}

.loading-screen.is-complete::before {
  animation: loadingExitCircle .58s forwards cubic-bezier(.76,0,.24,1);
}

.loading-screen.is-complete {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition-delay: .28s;
}

.loading-start {
  position: relative;
  z-index: 2;
  width: min(94vw, 900px);
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: clamp(26px, 5vw, 54px);
  border: 2px solid var(--ink);
  border-radius: 28px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 22px 0 rgba(9,9,9,.10);
  transition:
    transform .24s ease,
    box-shadow .24s ease;
}

.loading-start:disabled {
  cursor: default;
  transform: none;
}

.loading-brand {
  color: #ffdd00;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .24em;
}

.loading-title {
  display: block;
  margin-top: 28px;
  font-size: clamp(2.8rem, 8vw, 7.5rem);
  font-weight: 900;
  letter-spacing: -.065em;
  line-height: .88;
}

.loading-progress {
  position: relative;
  width: min(100%, 520px);
  height: 12px;
  margin-top: 38px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
}

.loading-progress i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  display: block;
  border-radius: inherit;
  background: var(--yellow);
}

.loading-screen.is-loading .loading-progress i {
  animation: loadingProgress 1.7s forwards cubic-bezier(.2,.75,.2,1);
}

.loading-hint {
  margin-top: 18px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .22em;
}

.loading-screen.is-loading .loading-hint {
  opacity: .45;
}

@keyframes loadingProgress {
  0% { width: 0; }
  62% { width: 78%; }
  100% { width: 100%; }
}

@keyframes loadingExitCircle {
  from { clip-path: circle(0 at 50% 50%); }
  to { clip-path: circle(80% at 50% 50%); }
}

/* El contador conserva las cinco piezas, sin cifra 0/5, 1/5, etc. */
.score-panel > strong {
  display: none !important;
}

.red-transition p,
.red-transition.is-visible p {
  color: var(--red);
  animation: none;
}

/* Elimina el halo azul situado en el centro de la ruta. */

@media (max-width: 760px) {
  .loading-start {
    border-radius: 20px;
    box-shadow: 0 14px 0 rgba(9,9,9,.10);
  }

  .loading-title {
    margin-top: 22px;
    font-size: clamp(2.45rem, 13vw, 4.5rem);
  }

  .loading-progress {
    height: 10px;
    margin-top: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-progress i,
  .loading-screen.is-complete::before,
  .red-transition.is-visible,
  .red-transition.is-visible p {
    animation-duration: .01ms !important;
  }
}


/* ═══════════════════════════════════════════════════════════════
   CORRECCIONES — REORDENAMIENTO, TRANSICIÓN RÁPIDA Y CABECERA
═══════════════════════════════════════════════════════════════ */

/* Las piezas cambian de lugar con una transición visible y sin superponerse. */
.ring-piece {
  transition:
    left .68s cubic-bezier(.2,.82,.2,1),
    top .68s cubic-bezier(.2,.82,.2,1),
    opacity .42s var(--piece-delay) ease,
    transform .55s var(--piece-delay) cubic-bezier(.2,.9,.2,1.18),
    color .22s ease,
    filter .22s ease;
}

.route-stage.is-reordering .ring-piece:not(.is-collected) svg {
  animation: routePieceReorder .68s cubic-bezier(.2,.82,.2,1);
}

@keyframes routePieceReorder {
  0%,100% { transform: scale(1) rotate(0); }
  45% { transform: scale(.82) rotate(-10deg); }
}
.red-transition.is-visible {
  animation-duration: 1.25s;
}

/* Caja blanca para que ENRÚTATE conserve contraste sobre el fondo amarillo. */
.hud-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 22px rgba(9,9,9,.08);
}

@media (max-width: 760px) {
  .hud-home {
    padding: 8px 10px;
    border-radius: 10px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   CORRECCIONES — PIEZAS GRANDES, TRANSICIÓN ROJA RESTAURADA
   Y CAJA DE INSTRUCCIÓN MÁS COMPACTA
═══════════════════════════════════════════════════════════════ */

/* Piezas principales más grandes, conservando sus posiciones seguras. */
.ring-piece {
  width: clamp(78px, 8vw, 128px);
}

/* La instrucción se ajusta al contenido en vez de ocupar casi todo el ancho. */
.route-help {
  width: max-content;
  max-width: min(86vw, 560px);
  padding: 13px 22px;
}

/* Se restaura la transición roja anterior con piezas, rayos y temblor. */

.red-transition p,
.red-transition.is-visible p {
  top: auto;
  bottom: 8vh;
  opacity: 0;
  transform: translateX(-50%);
}

.red-transition.is-visible p {
  animation: redText .7s .45s forwards ease;
}

@media (max-width: 760px) {
  .ring-piece {
    width: 64px;
  }

  .route-help {
    width: max-content;
    max-width: calc(100vw - 32px);
    padding: 11px 16px;
  }
}



/* ═══════════════════════════════════════════════════════════════
   CORRECCIONES — BORDES MÁS GRUESOS EN LOS MINIJUEGOS
═══════════════════════════════════════════════════════════════ */
.red-maze {
  border-width: 4px;
}

.blue-align-board {
  border-width: 4px;
}

@media (max-width: 760px) {
  .red-maze,
  .blue-align-board {
    border-width: 3px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   CORRECCIÓN — INICIO AUTOMÁTICO Y PEÓN SIN SOMBRA
═══════════════════════════════════════════════════════════════ */

/* La pantalla de carga ya no requiere clic y permanece estática mientras avanza. */
.loading-start {
  cursor: default;
}

.loading-start:hover,
.loading-start:focus-visible {
  transform: none;
  box-shadow: 0 22px 0 rgba(9,9,9,.10);
  outline: none;
}

/* El peón inicial y su fallback quedan completamente planos, sin sombra proyectada. */
.pawn-3d,
.pawn-fallback,
.pawn-fallback img {
  filter: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   PANTALLA DE SCROLL — SEMICÍRCULO BLANCO SOBRE FONDO AMARILLO
   Inspirada en la composición entregada, sin modificar la lógica.
═══════════════════════════════════════════════════════════════ */

/* El amarillo pertenece solo a la pantalla introductoria. */
.intro {
  overflow: hidden;
  background: #ffdd00;
  isolation: isolate;
}

/* Gran óvalo blanco: su parte inferior queda fuera de la pantalla,
   por eso se percibe como un semicírculo abierto hacia abajo. */
.intro-semicircle {
  position: absolute;
  z-index: 1;
  top: 2.7vh;
  left: 50%;
  width: 97vw;
  height: 158vh;
  border: clamp(4px, .42vw, 7px) solid var(--ink);
  border-radius: 50%;
  background: #ffffff;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Los contenidos quedan contenidos visualmente dentro del óvalo. */
.pawn-3d {
  z-index: 5;
  top: 22%;
}

.intro-copy {
  z-index: 4;
  left: 10.5vw;
  bottom: 10vh;
  max-width: min(54vw, 790px);
}

.intro-copy h1 {
  font-size: clamp(2.75rem, 5vw, 5.9rem);
  letter-spacing: -.068em;
  line-height: .88;
}

.intro-scroll {
  z-index: 5;
  right: 5.2vw;
  bottom: 7vh;
}

/* Dos señales circulares situadas en el recorrido vertical del peón. */
.intro-path-dots {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
}

.intro-path-dot {
  position: absolute;
  left: 50%;
  width: clamp(30px, 3.2vw, 52px);
  aspect-ratio: 1;
  border: clamp(4px, .36vw, 6px) solid var(--ink);
  border-radius: 50%;
  background: #ffffff;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  will-change: opacity, transform;
}

.intro-path-dot-one {
  top: 45%;
}

.intro-path-dot-two {
  top: 62%;
}

/*
 * EFECTO GOMA DEL PEÓN
 * JavaScript detecta el contacto real entre el peón y cada círculo.
 * Ya no depende de tiempos fijos, por lo que funciona en distintos tamaños.
 */
.scene.journey-playing .intro-path-dot-one,
.scene.journey-playing .intro-path-dot-two {
  animation: none;
}

.intro-path-dot {
  transition:
    opacity .16s ease-out,
    transform .22s cubic-bezier(.3,.7,.2,1),
    filter .22s ease-out;
}

.intro-path-dot.is-erased {
  opacity: 0;
  filter: blur(5px);
  transform: translate(-50%, -50%) scale(.08);
}

@media (max-width: 760px) {
  .intro-semicircle {
    top: 3.5vh;
    width: 95vw;
    height: 150vh;
    border-width: 4px;
  }

  .pawn-3d {
    top: 21%;
  }

  .intro-copy {
    left: 9vw;
    bottom: 12vh;
    max-width: 76vw;
  }

  .intro-copy h1 {
    font-size: clamp(2.15rem, 10.5vw, 4.1rem);
    line-height: .9;
  }

  .intro-path-dot {
  width: clamp(26px, 7vw, 38px);
  border-width: 3px;
}

  .intro-path-dot-one {
    top: 43%;
  }

  .intro-path-dot-two {
    top: 57%;
  }

  .intro-scroll {
    right: 7vw;
    bottom: 6vh;
  }
}

@media (max-height: 700px) and (min-width: 761px) {
  .intro-copy {
    bottom: 7vh;
  }

  .intro-copy h1 {
    font-size: clamp(2.6rem, 4.6vw, 5.1rem);
  }

  .intro-path-dot-one {
    top: 43%;
  }

  .intro-path-dot-two {
    top: 59%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-path-dot {
    transition-duration: .01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TERCERA PANTALLA — TRES OCTÁGONOS SOBRE FONDO AMARILLO
   Los octágonos se construyen completamente con CSS. El central
   queda delante y las piezas interactivas permanecen por encima.
═══════════════════════════════════════════════════════════════ */

.route-stage {
  overflow: hidden;
  background: #ffdd00;
  isolation: isolate;
}

.route-octagons {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.route-octagon {
  --octagon-border: clamp(5px, .42vw, 8px);
  position: absolute;
  top: 50%;
  aspect-ratio: 1;
  background: var(--ink);
  clip-path: polygon(
    28% 0,
    72% 0,
    100% 28%,
    100% 72%,
    72% 100%,
    28% 100%,
    0 72%,
    0 28%
  );
  transform: translate(-50%, -50%);
}

/* La capa interior blanca deja visible un borde negro real
   siguiendo toda la silueta del octágono. */
.route-octagon::after {
  position: absolute;
  inset: var(--octagon-border);
  content: "";
  background: #ffffff;
  clip-path: inherit;
}

.route-octagon-left,
.route-octagon-right {
  z-index: 1;
  width: min(42vw, 740px);
}

.route-octagon-left {
  left: 19.5%;
}

.route-octagon-right {
  left: 80.5%;
}

.route-octagon-center {
  z-index: 2;
  left: 50%;
  width: min(45vw, 790px);
}

/* Mantiene todos los elementos funcionales delante del fondo. */

.route-stage .nut-ring {
  z-index: 6;
}

.route-stage .route-help {
  z-index: 12;
}

/* Durante el fundido de entrada, los octágonos aparecen juntos
   y el central avanza levemente para reforzar la profundidad. */
.route-stage.is-cinematic .route-octagon-left,
.route-stage.is-cinematic .route-octagon-right {
  animation: routeSideOctagonIn 1.05s .18s both cubic-bezier(.18,.82,.2,1);
}

.route-stage.is-cinematic .route-octagon-center {
  animation: routeCenterOctagonIn 1.12s .25s both cubic-bezier(.18,.88,.2,1.05);
}

@keyframes routeSideOctagonIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.86);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes routeCenterOctagonIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.78);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.025);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (max-width: 760px) {
  .route-octagon {
    --octagon-border: 4px;
  }

  .route-octagon-left,
  .route-octagon-right {
    width: 76vw;
  }

  .route-octagon-left {
    left: -1%;
  }

  .route-octagon-right {
    left: 101%;
  }

  .route-octagon-center {
    left: 50%;
    width: 88vw;
  }
}

@media (max-height: 700px) and (min-width: 761px) {
  .route-octagon-left,
  .route-octagon-right {
    width: min(38vw, 610px);
  }

  .route-octagon-center {
    width: min(41vw, 660px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .route-stage.is-cinematic .route-octagon-left,
  .route-stage.is-cinematic .route-octagon-right,
  .route-stage.is-cinematic .route-octagon-center {
    animation-duration: .01ms !important;
  }
}


/* ═══════════════════════════════════════════════════════════════
   PIEZAS ORDENADAS DENTRO DE LOS TRES OCTÁGONOS
   Las coordenadas se controlan desde DESKTOP_LAYOUT y MOBILE_LAYOUT
   en exploracion.js. Esta sección ajusta las figuras en pantallas pequeñas.
═══════════════════════════════════════════════════════════════ */

/* El fondo atmosférico se suaviza para que la organización por octágonos
   se lea con claridad detrás de las piezas. */

@media (max-width: 900px), (orientation: portrait) {
  /* En pantallas compactas los octágonos laterales permanecen parcialmente visibles,
     pero ofrecen superficie suficiente para alojar cuatro piezas cada uno. */
  .route-octagon-left,
  .route-octagon-right {
    width: 72vw;
  }

  .route-octagon-left {
    left: 18%;
  }

  .route-octagon-right {
    left: 82%;
  }

  .route-octagon-center {
    width: 80vw;
  }

  .ring-piece {
    width: clamp(54px, 15.5vw, 64px);
  }
}


/* ═══════════════════════════════════════════════════════════════
   NUEVA TRANSICIÓN ROJA — EXPLOSIÓN Y ZOOM DE PIEZAS
   Una pieza central crece, se multiplica y llena la pantalla.
═══════════════════════════════════════════════════════════════ */

.red-transition {
  overflow: hidden;
  background: #ffffff;
}

.red-explosion-stage,
.red-explosion-seeds,
.red-explosion-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.red-explosion-stage {
  z-index: 2;
}

.red-explosion-origin {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: clamp(180px, 23vw, 360px);
  aspect-ratio: 122.48 / 118.66;
  color: var(--red);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.12) rotate(-12deg);
  transform-origin: center;
  will-change: transform, opacity;
}

.red-explosion-origin svg,
.red-explosion-seed svg,
.red-explosion-particle svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.red-transition.is-visible .red-explosion-origin {
  animation: redExplosionOrigin 1.05s .04s both cubic-bezier(.12,.82,.16,1);
}

.red-explosion-seed,
.red-explosion-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  aspect-ratio: 122.48 / 118.66;
  color: var(--red);
  opacity: 0;
  transform-origin: center;
  will-change: transform, opacity;
}

.red-explosion-seed {
  z-index: 3;
  width: clamp(82px, 8.8vw, 142px);
  transform: translate(-50%, -50%) scale(.04);
}

.red-explosion-particle {
  z-index: 2;
  width: clamp(68px, var(--particle-size, 8vw), 150px);
  transform: translate(-50%, -50%) scale(.02);
}

/* La instrucción aparece después de que la pantalla ya está llena. */
/* La transición termina directamente en el minijuego, sin cartel intermedio. */
.red-transition p {
  display: none !important;
}

/* La antigua retícula, los rayos y el temblor dejan de intervenir. */

@keyframes redExplosionOrigin {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.1) rotate(-14deg);
  }
  18% {
    opacity: 1;
  }
  58% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.18) rotate(3deg);
  }
  76% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.42) rotate(-2deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.22) rotate(18deg);
  }
}

@media (max-width: 760px) {
  .red-explosion-origin {
    width: clamp(145px, 42vw, 220px);
  }

  .red-explosion-seed {
    width: clamp(66px, 19vw, 100px);
  }

  .red-explosion-particle {
    width: clamp(52px, var(--particle-size, 17vw), 108px);
  }

  .red-transition p,
  .red-transition.is-visible p {
    bottom: 7vh;
    font-size: 11px;
    letter-spacing: .2em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .red-transition.is-visible,
  .red-transition.is-visible .red-explosion-origin,
  .red-transition.is-visible .red-explosion-seed,
  .red-transition.is-visible .red-explosion-particle,
  .red-transition.is-visible p {
    animation-duration: .01ms !important;
  }
}


/* ═══════════════════════════════════════════════════════════════
   CIERRE FLUIDO DE LA EXPLOSIÓN ROJA
   El minijuego aparece debajo mientras las últimas piezas continúan
   expandiéndose. No existe pausa ni fotograma congelado al final.
═══════════════════════════════════════════════════════════════ */

/* La capa oculta se retira de forma inmediata, anulando el antiguo
   fundido de 0,58 s que dejaba piezas detenidas sobre el minijuego. */
.red-transition[aria-hidden="true"] {
  visibility: hidden;
  opacity: 0 !important;
  filter: none !important;
  transition: none !important;
}

.red-transition[aria-hidden="false"] {
  visibility: visible;
}

.red-transition.is-visible {
  animation: redExplosionScreenFluid 2.02s both cubic-bezier(.2,.78,.16,1) !important;
}

.red-transition.is-handoff {
  pointer-events: none;
  transition: none !important;
}

.red-transition.is-visible .red-explosion-particle {
  animation:
    redExplosionParticleFluid 1.22s var(--particle-delay, .54s)
    both cubic-bezier(.12,.72,.12,1);
}

.red-transition.is-visible .red-explosion-seed {
  animation:
    redExplosionSeedFluid 1.05s var(--seed-delay, .31s)
    both cubic-bezier(.12,.78,.14,1);
}

/* El tablero entra sin la antigua demora escalonada. */
.red-game {
  transition:
    opacity .3s ease-out,
    filter .3s ease-out,
    transform .36s cubic-bezier(.2,.8,.2,1);
}

.red-game-heading,
.red-maze,
.red-game-status {
  transition:
    opacity .3s ease-out,
    transform .34s cubic-bezier(.2,.8,.2,1);
}

.red-game.is-visible .red-game-heading,
.red-game.is-visible .red-maze,
.red-game.is-visible .red-game-status {
  transition-delay: 0s;
}

@keyframes redExplosionScreenFluid {
  0% {
    opacity: 0;
    background-color: #ffffff;
  }
  6%, 70% {
    opacity: 1;
    background-color: #ffffff;
  }
  84% {
    opacity: 1;
    background-color: rgba(255,255,255,.72);
  }
  100% {
    opacity: 1;
    background-color: rgba(255,255,255,0);
  }
}

@keyframes redExplosionSeedFluid {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.02) rotate(0deg);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(.25) rotate(0deg);
  }
  68% {
    opacity: 1;
    transform:
      translate(
        calc(-50% + var(--seed-x)),
        calc(-50% + var(--seed-y))
      )
      scale(1.08)
      rotate(var(--seed-rotation));
  }
  100% {
    opacity: 0;
    transform:
      translate(
        calc(-50% + var(--seed-x)),
        calc(-50% + var(--seed-y))
      )
      scale(1.7)
      rotate(calc(var(--seed-rotation) + 44deg));
  }
}

@keyframes redExplosionParticleFluid {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.02) rotate(0deg);
  }
  12% {
    opacity: 1;
  }
  34% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(.3) rotate(0deg);
  }
  72% {
    opacity: 1;
    transform:
      translate(
        calc(-50% + var(--particle-x)),
        calc(-50% + var(--particle-y))
      )
      scale(var(--particle-scale, 1.18))
      rotate(var(--particle-rotation, 0deg));
  }
  100% {
    opacity: 0;
    transform:
      translate(
        calc(-50% + var(--particle-exit-x)),
        calc(-50% + var(--particle-exit-y))
      )
      scale(var(--particle-exit-scale, 2))
      rotate(calc(var(--particle-rotation, 0deg) + 34deg));
  }
}

@media (prefers-reduced-motion: reduce) {
  .red-transition.is-visible,
  .red-transition.is-visible .red-explosion-seed,
  .red-transition.is-visible .red-explosion-particle,
  .red-game,
  .red-game-heading,
  .red-maze,
  .red-game-status {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}


/* ═══════════════════════════════════════════════════════════════
   REDISEÑO DEL MINIJUEGO AZUL — ANILLOS CON CAMINOS BLANCOS
   Tres anillos concéntricos giran de forma independiente. El desafío
   termina cuando los cuatro caminos blancos llegan al centro verde.
═══════════════════════════════════════════════════════════════ */

.blue-game {
  background: #ffffff;
}

.blue-game.is-aligning .blue-wheel,
.blue-game.is-aligning .blue-break-piece {
  display: none !important;
}

.blue-game.is-aligning .blue-align-stage {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.blue-title {
  color: var(--blue);
}

.blue-title::after {
  background: var(--blue);
}

.blue-counter {
  bottom: 5.5vh;
  color: rgba(9,9,9,.62);
}

.blue-align-stage {
  top: 51%;
  width: min(72vh, 76vw, 720px);
  height: min(72vh, 76vw, 720px);
  filter: none;
  transform: translate(-50%, -50%) scale(.9);
}

.blue-align-board {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}

.blue-align-board::before,
.blue-align-board::after {
  display: none !important;
}

.blue-concentric-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.blue-puzzle-disc {
  fill: var(--blue);
  stroke: var(--green);
  stroke-width: 12;
}

.blue-puzzle-ring {
  cursor: grab;
  outline: none;
  transform-box: view-box;
  transform-origin: 300px 300px;
  transition: transform .38s cubic-bezier(.2,.82,.2,1);
  will-change: transform;
}

.blue-puzzle-ring.is-dragging {
  cursor: grabbing;
  transition: none;
}


.blue-puzzle-ring-base {
  fill: none;
  stroke: var(--blue);
  pointer-events: none;
}

.blue-puzzle-white-path {
  fill: #ffffff;
  pointer-events: none;
}

.blue-puzzle-boundary {
  fill: none;
  stroke: rgba(255,255,255,.94);
  stroke-width: 4;
  pointer-events: none;
}

.blue-puzzle-hit {
  fill: none;
  stroke: rgba(255,255,255,.001);
  pointer-events: stroke;
  transition: stroke .2s ease;
}

.blue-puzzle-ring:hover .blue-puzzle-boundary,
.blue-puzzle-ring:focus-visible .blue-puzzle-boundary {
  stroke: #ffdd00;
}

.blue-game.is-aligned .blue-puzzle-hit {
  stroke: rgba(255,255,255,.001) !important;
}

.blue-puzzle-core-guides {
  pointer-events: none;
}

.blue-puzzle-core-path {
  fill: #ffffff;
}

.blue-puzzle-core {
  fill: var(--green);
  stroke: #ffffff;
  stroke-width: 5;
  transform-box: fill-box;
  transform-origin: center;
}

.blue-align-help {
  bottom: -34px;
  color: rgba(9,9,9,.58);
  font-size: 9px;
  letter-spacing: .16em;
}

.blue-game.is-aligned .blue-align-board {
  animation: blueRingPuzzleVictory .82s both cubic-bezier(.2,.8,.2,1);
  box-shadow: none;
}

.blue-game.is-aligned .blue-puzzle-disc {
  stroke: var(--green);
  animation: blueRingRimVictory .82s ease;
}

.blue-game.is-aligned .blue-puzzle-core {
  animation: blueRingCoreVictory .82s ease;
}

@keyframes blueRingPuzzleVictory {
  0%,100% { transform: scale(1); }
  42% { transform: scale(1.025); }
  72% { transform: scale(.995); }
}

@keyframes blueRingRimVictory {
  0%,100% { stroke-width: 12; }
  45% { stroke-width: 22; }
}

@keyframes blueRingCoreVictory {
  0%,100% { transform: scale(1) rotate(0); }
  48% { transform: scale(1.18) rotate(12deg); }
}

@media (max-width: 760px) {
  .blue-title {
    font-size: 9px;
    letter-spacing: .14em;
  }

  .blue-counter {
    bottom: 5vh;
    width: min(90vw, 520px);
    font-size: 8px;
    letter-spacing: .12em;
  }

  .blue-align-stage {
    top: 50%;
    width: min(82vw, 64vh, 560px);
    height: min(82vw, 64vh, 560px);
  }

  .blue-align-help {
    bottom: -28px;
    font-size: 7px;
    letter-spacing: .1em;
  }

  .blue-puzzle-disc {
    stroke-width: 10;
  }

  .blue-puzzle-boundary {
    stroke-width: 5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blue-puzzle-ring,
  .blue-game.is-aligned .blue-align-board,
  .blue-game.is-aligned .blue-puzzle-disc,
  .blue-game.is-aligned .blue-puzzle-core {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}


/* ═══════════════════════════════════════════════════════════════
   CORRECCIÓN — UNA SOLA INSTRUCCIÓN AZUL EN LA PARTE INFERIOR
   Se ocultan los textos secundarios de abajo y la instrucción principal
   se traslada desde la cabecera hacia una zona libre bajo la interacción.
═══════════════════════════════════════════════════════════════ */
.blue-counter,
.blue-align-help {
  display: none !important;
}

.blue-title {
  top: auto;
  bottom: max(34px, 5.5vh);
  width: min(88vw, 760px);
  padding-bottom: 0;
}

@media (max-width: 760px) {
  .blue-title {
    top: auto;
    bottom: max(26px, 4.5vh);
    width: min(88vw, 520px);
  }
}

@media (max-height: 700px) and (min-width: 761px) {
  .blue-title {
    top: auto;
    bottom: 28px;
  }
}
