:root {
    --juegos-morado: #673ab7;
    --juegos-azul: #087ca7;
    --juegos-tinta: #172033;
}

html { scroll-behavior: smooth; }

.pagina-juegos {
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 24%, rgba(103, 58, 183, .11), transparent 26rem),
        radial-gradient(circle at 90% 66%, rgba(8, 124, 167, .1), transparent 24rem),
        #f6f7ff;
    color: var(--juegos-tinta);
    font-family: "Nunito", sans-serif;
}

.hero-juegos {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    align-items: center;
    gap: clamp(28px, 6vw, 86px);
    width: min(1180px, calc(100% - 40px));
    min-height: 500px;
    margin: 0 auto;
    padding: 90px 0 60px;
}

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

.hero-juegos__etiqueta,
.catalogo-juegos__sobrelinea {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--juegos-morado);
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hero-juegos h1 {
    max-width: 720px;
    margin: 16px 0 18px;
    font-family: "Montserrat", sans-serif;
    font-size: clamp(2.65rem, 6vw, 5.4rem);
    font-weight: 800;
    line-height: .98;
    letter-spacing: -.055em;
}

.hero-juegos__contenido > p {
    max-width: 660px;
    margin-bottom: 28px;
    color: #526074;
    font-size: clamp(1.08rem, 2vw, 1.32rem);
    line-height: 1.65;
}

.hero-juegos__boton,
.tarjeta-juego__boton {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--juegos-morado), #895ce0);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease, gap .25s ease;
}

.hero-juegos__boton { min-height: 54px; padding: 0 24px; box-shadow: 0 14px 32px rgba(103, 58, 183, .28); }
.hero-juegos__boton:hover,
.hero-juegos__boton:focus-visible,
.tarjeta-juego__boton:hover,
.tarjeta-juego__boton:focus-visible {
    transform: translateY(-3px);
    color: #fff;
    text-decoration: none;
}

.hero-juegos__escena {
    position: relative;
    display: grid;
    place-items: center;
    width: min(390px, 80vw);
    aspect-ratio: 1;
    margin: auto;
    border-radius: 44% 56% 63% 37% / 40% 39% 61% 60%;
    background: linear-gradient(145deg, #efe9ff, #d8eeff);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.86), 0 28px 70px rgba(50,43,104,.17);
    animation: formaFlotante 8s ease-in-out infinite;
}

.control-juego {
    z-index: 2;
    display: grid;
    place-items: center;
    width: 170px;
    height: 170px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 42px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 25px 50px rgba(45,35,91,.18);
    color: var(--juegos-morado);
    font-size: 5rem;
    transform: rotate(-8deg);
    backdrop-filter: blur(12px);
}

.orbita {
    position: absolute;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(48,38,95,.18);
    font-size: 1.55rem;
    animation: iconoFlotante 4s ease-in-out infinite;
}

.orbita--uno { top: 10%; left: 8%; color: #ffb000; }
.orbita--dos { top: 16%; right: 3%; color: #ed5b8b; animation-delay: -1.4s; }
.orbita--tres { right: 8%; bottom: 8%; color: var(--juegos-azul); animation-delay: -2.6s; }

.catalogo-juegos {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 50px 0 100px;
}

.catalogo-juegos__encabezado {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 440px);
    align-items: end;
    gap: 30px;
    margin-bottom: 34px;
}

.catalogo-juegos__sobrelinea { margin-bottom: 8px; font-size: .78rem; }
.catalogo-juegos h2 {
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -.04em;
}
.catalogo-juegos__encabezado p { margin: 0; color: #667085; font-size: 1.05rem; line-height: 1.65; }

.lista-juegos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cargando-juegos {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 240px;
    color: var(--juegos-morado);
    font-weight: 800;
}

.tarjeta-juego {
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(165px, .65fr) 1.35fr;
    min-height: 330px;
    border: 1px solid rgba(24,32,51,.08);
    border-radius: 28px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 20px 48px rgba(32,39,71,.09);
    opacity: 0;
    transform: translateY(18px);
    animation: tarjetaEntrada .65s cubic-bezier(.2,.8,.2,1) forwards;
    animation-delay: var(--retraso, 0ms);
}

.tarjeta-juego__visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 230px;
    padding: 25px;
    background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.38), transparent 5rem), linear-gradient(145deg, #6c3fc2, #3b2375);
}
.tarjeta-juego--azul .tarjeta-juego__visual {
    background: radial-gradient(circle at 28% 24%, rgba(255,255,255,.38), transparent 5rem), linear-gradient(145deg, #129cc4, #075979);
}
.tarjeta-juego__visual::after {
    content: "";
    position: absolute;
    width: 130px;
    height: 130px;
    border: 1px solid rgba(255,255,255,.27);
    border-radius: 50%;
    animation: pulsoJuego 3.4s ease-out infinite;
}
.tarjeta-juego__icono { z-index: 2; color: #fff; font-size: 4rem; filter: drop-shadow(0 15px 18px rgba(28,14,61,.25)); }
.tarjeta-juego__estado {
    position: absolute;
    top: 18px;
    left: 18px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.94);
    color: #315033;
    font-size: .76rem;
    font-weight: 800;
}
.tarjeta-juego__cuerpo { display: flex; flex-direction: column; align-items: flex-start; padding: 30px; }
.tarjeta-juego h3 { margin: 0 0 12px; font-family: "Montserrat", sans-serif; font-size: 1.5rem; font-weight: 800; line-height: 1.18; }
.tarjeta-juego__cuerpo > p { margin-bottom: 18px; color: #667085; line-height: 1.55; }
.tarjeta-juego__etiquetas { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 24px; }
.tarjeta-juego__etiquetas span { padding: 6px 9px; border-radius: 9px; background: #f0ecfb; color: #57379d; font-size: .75rem; font-weight: 800; }
.tarjeta-juego--azul .tarjeta-juego__etiquetas span { background: #e5f6fb; color: #087494; }
.tarjeta-juego__boton { min-height: 46px; margin-top: auto; padding: 0 18px; border-radius: 13px; }
.tarjeta-juego--azul .tarjeta-juego__boton { background: var(--juegos-azul); }
.tarjeta-juego__boton:hover { gap: 16px; }

.proximamente-juegos {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 28px;
    padding: 22px 26px;
    border: 1px dashed rgba(103,58,183,.28);
    border-radius: 21px;
    background: rgba(255,255,255,.7);
}
.proximamente-juegos__icono { flex: 0 0 48px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: #eee7fc; color: var(--juegos-morado); }
.proximamente-juegos h3 { margin: 0 0 3px; font-size: 1.05rem; font-weight: 800; }
.proximamente-juegos p { margin: 0; color: #667085; }

.acceso-docente-juegos {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 18px;
    margin-top: 18px;
    padding: 23px 25px;
    border-radius: 21px;
    background: linear-gradient(125deg, #252354, #5839a5);
    color: #fff;
    box-shadow: 0 18px 42px rgba(55, 40, 112, .2);
}
.acceso-docente-juegos__icono { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 17px; background: rgba(255,255,255,.13); font-size: 1.35rem; }
.acceso-docente-juegos span { color: #d5c9ff; font-size: .68rem; font-weight: 900; letter-spacing: .13em; }
.acceso-docente-juegos h3 { margin: 3px 0 4px; font-size: 1.08rem; font-weight: 800; }
.acceso-docente-juegos p { margin: 0; color: rgba(255,255,255,.72); line-height: 1.45; }
.acceso-docente-juegos > a { display: inline-flex; align-items: center; gap: 9px; min-height: 45px; padding: 0 17px; border-radius: 13px; background: #fff; color: #4d3299; text-decoration: none; font-weight: 850; white-space: nowrap; transition: transform .2s ease, box-shadow .2s ease; }
.acceso-docente-juegos > a:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.18); }

@keyframes formaFlotante {
    0%,100% { transform: translateY(0) rotate(0); border-radius: 44% 56% 63% 37% / 40% 39% 61% 60%; }
    50% { transform: translateY(-12px) rotate(2deg); border-radius: 57% 43% 42% 58% / 55% 57% 43% 45%; }
}
@keyframes iconoFlotante { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-12px) rotate(4deg); } }
@keyframes pulsoJuego { 0% { opacity: .8; transform: scale(.75); } 100% { opacity: 0; transform: scale(1.45); } }
@keyframes tarjetaEntrada { to { opacity: 1; transform: translateY(0); } }

@media (max-width: 950px) {
    .hero-juegos { grid-template-columns: 1fr .72fr; }
    .lista-juegos { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .pagina-juegos { padding-bottom: 72px; }
    .hero-juegos { grid-template-columns: 1fr; width: min(100% - 28px, 620px); padding: 56px 0 38px; text-align: center; }
    .hero-juegos__contenido { display: flex; flex-direction: column; align-items: center; }
    .hero-juegos h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
    .hero-juegos__escena { width: min(280px, 74vw); }
    .control-juego { width: 126px; height: 126px; border-radius: 32px; font-size: 3.8rem; }
    .orbita { width: 48px; height: 48px; border-radius: 15px; font-size: 1.25rem; }
    .catalogo-juegos { width: min(100% - 28px, 620px); padding: 38px 0 70px; }
    .catalogo-juegos__encabezado { grid-template-columns: 1fr; gap: 15px; text-align: center; }
    .tarjeta-juego { grid-template-columns: 1fr; }
    .tarjeta-juego__visual { min-height: 180px; }
    .tarjeta-juego__cuerpo { padding: 25px 22px; }
    .proximamente-juegos { align-items: flex-start; padding: 20px; }
    .acceso-docente-juegos { grid-template-columns: 50px 1fr; padding: 20px; }
    .acceso-docente-juegos > a { grid-column: 1 / -1; justify-content: center; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero-juegos__escena, .orbita, .tarjeta-juego__visual::after, .tarjeta-juego { animation: none; }
    .tarjeta-juego { opacity: 1; transform: none; }
}
