:root {
    /* Variables editables para modales/juegos: reemplaza estos valores si cambia la paleta del sitio. */
    --color-primario: #003366;
    --color-secundario: #005599;
    --color-acento: #ffcc00;
    --bg-modal: rgba(255, 255, 255, 0.96);
    --bg-overlay: rgba(0, 20, 45, 0.72);
    --fuente-principal: inherit;

    --azul-oscuro: #003366;
    --azul: #005599;
    --azul-claro: #0f80bd;
    --dorado: #ffcc00;
    --dorado-oscuro: #dca900;
    --gris-fondo: #eceff3;
    --gris-borde: #d8dde4;
    --texto: #243241;
    --blanco: #ffffff;
    --radio-sm: 12px;
    --radio-md: 16px;
    --radio-lg: 22px;
    --sombra-suave: 0 16px 40px rgba(0, 30, 70, 0.12);
    --sombra-card: 0 12px 26px rgba(0, 30, 70, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--gris-fondo);
    color: var(--texto);
    overflow-x: hidden;
}

a {
    color: inherit;
}

img,
video,
iframe {
    max-width: 100%;
}

.formula,
.math-formula,
.unidad-fisica {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2em;
    max-width: 100%;
    padding: 0.22rem 0.44rem;
    border: 1px solid rgba(0, 85, 153, 0.16);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.82);
    color: var(--azul-oscuro);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    line-height: 1.25;
    vertical-align: middle;
    white-space: normal;
}

.formula.clean,
.math-formula.clean,
.unidad-fisica.clean {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.formula.big,
.math-formula.big {
    padding: 0.42rem 0.7rem;
    font-size: clamp(1rem, 1.6vw, 1.18rem);
}

.formula sub,
.formula sup,
.math-formula sub,
.math-formula sup,
.unidad-fisica sub,
.unidad-fisica sup {
    font-size: 0.68em;
    line-height: 0;
}

.frac,
.math-frac {
    display: inline-grid;
    grid-template-rows: auto auto;
    place-items: center;
    min-width: 2.1em;
    margin: 0 0.12em;
    vertical-align: middle;
}

.frac .top,
.math-frac .top {
    width: 100%;
    padding: 0 0.25em 0.08em;
    border-bottom: 2px solid currentColor;
    text-align: center;
}

.frac .bottom,
.math-frac .bottom {
    padding: 0.08em 0.25em 0;
    text-align: center;
}

body > header,
.top-header {
    width: calc(100% - clamp(16px, 3vw, 72px));
    margin: clamp(8px, 1.5vw, 24px) auto 0;
    padding: 18px clamp(18px, 3vw, 44px);
    background: var(--blanco) !important;
    color: var(--texto) !important;
    border: 1px solid #d5dbe3;
    border-top: 5px solid var(--azul-oscuro);
    border-radius: var(--radio-lg) var(--radio-lg) 0 0;
    box-shadow: var(--sombra-suave);
}

body > header h1,
.top-header h1 {
    margin: 0;
    color: var(--azul-oscuro);
    font-size: 30px;
    line-height: 1.08;
}

body > header p,
.top-header p {
    margin: 6px 0 0;
    color: #617182;
    font-size: 14px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.user-avatar-box {
    min-width: 120px;
    color: var(--azul-oscuro) !important;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.user-avatar-img {
    width: 112px !important;
    height: 112px !important;
    border: 4px solid rgba(0, 85, 153, 0.14) !important;
    box-shadow: 0 8px 18px rgba(0, 51, 102, 0.14);
}

.info-usuario {
    min-width: 0;
}

.header-links,
.logout {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    font-size: 13px;
}

.header-links a,
.logout a,
.btn,
.btn-comprar,
.btn-siguiente,
.btn-finalizar,
.btn-reintentar,
.candado button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 0;
    border-radius: 999px;
    background: var(--azul);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.header-links a:hover,
.logout a:hover,
.btn:hover,
.btn-comprar:hover,
.btn-siguiente:hover,
.btn-finalizar:hover,
.btn-reintentar:hover,
.candado button:hover {
    background: var(--azul-oscuro);
    text-decoration: none;
}

.mensaje,
.mensaje-servidor {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #ffe08a;
    border-left: 5px solid var(--dorado);
    border-radius: var(--radio-md);
    background: #fff8dc;
    color: #644b00;
    font-size: 14px;
}

.contenedor,
.admin-layout,
.layout {
    width: calc(100% - clamp(16px, 3vw, 72px));
    margin: 0 auto 24px;
}

.contenedor,
.admin-layout {
    padding: clamp(18px, 2.4vw, 34px);
    background: var(--blanco);
    border: 1px solid #d5dbe3;
    border-top: 0;
    border-radius: 0 0 var(--radio-lg) var(--radio-lg);
    box-shadow: var(--sombra-suave);
}

.layout {
    display: grid !important;
    grid-template-columns: minmax(210px, 285px) minmax(0, 1fr) minmax(250px, 330px);
    align-items: stretch;
    gap: clamp(14px, 1.7vw, 24px);
    padding: clamp(14px, 2vw, 30px);
    background: var(--blanco);
    border: 1px solid #d5dbe3;
    border-top: 0;
    border-radius: 0 0 var(--radio-lg) var(--radio-lg);
    box-shadow: var(--sombra-suave);
}

.sidebar {
    width: auto !important;
    padding: 14px !important;
    background: var(--azul) !important;
    color: #fff;
    border: 1px solid rgba(0, 51, 102, 0.15);
    border-radius: var(--radio-lg);
}

.sidebar h3 {
    margin: 0 0 12px;
    text-align: left !important;
    color: #fff;
    font-size: 18px;
}

.unidad-btn {
    min-height: 38px;
    margin: 0 0 7px !important;
    border-radius: var(--radio-md) !important;
    background: var(--azul-oscuro) !important;
}

.unidad-btn:hover {
    background: #00457d !important;
}

.submenu {
    padding-left: 0 !important;
}

.submenu a {
    padding: 7px 9px !important;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    color: #f6fbff !important;
}

.content,
.right-panel {
    width: auto !important;
    min-width: 0;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.content h2,
.right-panel h3,
.card h2,
.item-card h2,
.card-examen h2,
.contenedor h1,
.contenedor h2,
.panel-escape h2,
.mision h3,
.candado h2 {
    color: var(--azul-oscuro);
}

.content-box,
.leaderboard,
.widget-extra,
.card,
.item-card,
.card-examen,
.puntaje-actual,
.panel-escape,
.mision,
.candado,
.mensaje-completado,
.final {
    background: var(--blanco) !important;
    border: 1px solid var(--gris-borde) !important;
    border-radius: var(--radio-lg) !important;
    box-shadow: var(--sombra-card) !important;
}

.content-box,
.leaderboard,
.widget-extra,
.card,
.item-card,
.card-examen,
.puntaje-actual,
.panel-escape {
    padding: 16px !important;
}

.grid,
.grid-tienda {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    align-items: start;
}

.usuarios-card {
    grid-column: span 2;
}

.item-card {
    min-width: 0;
    justify-content: flex-start;
    gap: 12px;
}

.item-card img {
    width: 112px !important;
    height: 112px !important;
    object-fit: contain;
    border: 1px solid var(--gris-borde);
    background: #f8fafc;
    padding: 8px;
}

input,
select,
textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #cfd8e3;
    border-radius: var(--radio-sm);
    background: #fff;
    color: var(--texto);
    font-family: inherit;
    font-size: 13px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 2px rgba(0, 85, 153, 0.12);
    outline: none;
}

label {
    color: #415264;
}

.lista-usuarios,
.bonos-wrapper,
.practicas-wrap {
    overflow-x: auto;
}

.embed-responsive {
    width: 100%;
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid var(--gris-borde);
    background: #f8fafc;
    border-radius: var(--radio-lg);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    border: 1px solid #dbe2ea;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--azul-oscuro) !important;
    color: #fff;
}

tr:nth-child(even) {
    background: #f7f9fc;
}

.personajes-opciones,
.personajes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 10px;
}

.personaje-card {
    border: 1px solid var(--gris-borde) !important;
    border-radius: var(--radio-md) !important;
    background: #f8fafc !important;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.personaje-card:hover {
    border-color: var(--azul) !important;
    box-shadow: 0 6px 16px rgba(0, 85, 153, 0.13);
    transform: translateY(-1px);
}

.personaje-card img {
    border: 3px solid rgba(0, 85, 153, 0.12);
}

.page-first-login {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.page-first-login .contenedor {
    width: min(820px, 100%);
    margin: 0;
    border-top: 5px solid var(--azul-oscuro);
}

.page-first-login .reset-container {
    width: min(520px, 100%);
}

.page-activity {
    padding: 18px;
}

.page-activity .contenedor,
.page-activity .panel-escape {
    width: min(1100px, 100%);
    margin: 0 auto 20px;
    border-top: 5px solid var(--azul-oscuro) !important;
}

.page-activity h1 {
    width: min(1100px, 100%);
    margin: 0 auto 14px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #d5dbe3;
    border-top: 5px solid var(--azul-oscuro);
    border-radius: var(--radio-lg);
    color: var(--azul-oscuro);
    text-align: left !important;
    box-shadow: var(--sombra-card);
}

.page-activity .intro {
    width: min(1100px, 100%);
    max-width: none;
    margin: 0 auto 18px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-lg);
}

.page-activity img {
    height: auto !important;
}

.barra-progreso {
    background: #dce5ee !important;
}

.barra-progreso-interno {
    background: linear-gradient(90deg, var(--azul), var(--dorado)) !important;
}

.opciones button {
    border: 1px solid #cfd8e3 !important;
    border-radius: var(--radio-md) !important;
}

.opciones button:hover {
    background: #f1f6fb !important;
}

.correcta,
.feedback.ok,
.correcto {
    color: #0b7a20 !important;
}

.incorrecta,
.feedback.fail,
.incorrecto {
    color: #a00000 !important;
}

.badge-pendiente,
.item-costo {
    color: #5b4600 !important;
    background: #fff3bf;
    border: 1px solid #ffe08a;
    border-radius: var(--radio-sm);
    padding: 4px 7px;
    width: fit-content;
}

.nota,
.info-intentos {
    color: #526272;
    font-size: 13px;
}

.page-shell,
.access-panel,
.side-menu,
.side-image,
.course-card,
.video-card,
.material-card,
.info-tile,
.hero,
.modal-overlay .apoyo-modal,
.topic-strip {
    border-radius: var(--radio-lg) !important;
}

.page-shell {
    overflow: hidden;
    box-shadow: var(--sombra-suave) !important;
}

.login-form input,
.quick-request input,
.quick-request textarea,
.contacto-form input,
.contacto-form select,
.contacto-form textarea {
    border-radius: var(--radio-sm) !important;
}

.login-form button,
.btn-dorado,
.material-btn,
.contacto-form button,
.modal-close,
nav .nav-cta {
    border-radius: 999px !important;
}

.forgot-password-link {
    display: inline-flex;
    width: fit-content;
    margin-top: 10px;
    color: var(--azul-oscuro);
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
}

.forgot-password-link:hover {
    color: var(--azul);
    text-decoration: underline;
}

.unidades-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.unidad-config-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-lg);
    background: #f8fafc;
    box-shadow: 0 10px 24px rgba(0, 30, 70, 0.08);
}

.unidad-config-title,
.actividad-config-list label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.unidad-config-title {
    color: var(--azul-oscuro);
    font-weight: bold;
    line-height: 1.35;
}

.actividad-config-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gris-borde);
}

.actividad-config-list label {
    padding: 8px;
    border-radius: var(--radio-sm);
    background: #fff;
    color: var(--texto);
    font-size: 13px;
    line-height: 1.35;
}

.unidad-config-card input {
    flex: 0 0 auto;
    margin-top: 2px;
}

nav {
    border-radius: 0 0 var(--radio-lg) var(--radio-lg);
}

.modal-header {
    border-radius: var(--radio-lg) var(--radio-lg) 0 0;
}

.material-card,
.info-tile,
.access-panel {
    box-shadow: var(--sombra-card);
}

.banner-admin-form {
    display: grid;
    gap: 16px;
}

.banner-global-setting {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(96px, 140px);
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-md);
    background: #f8fafc;
}

.banner-global-setting label,
.banner-slide-card label {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: var(--azul-oscuro);
    font-weight: bold;
}

.banner-global-setting label span {
    color: #64748b;
    font-size: 12px;
    font-weight: normal;
}

.banner-global-setting input,
.banner-slide-card input[type="text"],
.banner-slide-card input[type="file"],
.banner-slide-card textarea {
    width: 100%;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-md);
    background: #fff;
    color: var(--texto);
    font: inherit;
}

.banner-slide-card textarea {
    resize: vertical;
}

.banner-slides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
}

.banner-slide-card {
    min-width: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-lg);
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(0, 30, 70, 0.08);
}

.banner-slide-card legend {
    padding: 0 8px;
    color: var(--azul-oscuro);
    font-weight: bold;
}

.banner-preview {
    width: 100%;
    aspect-ratio: 16 / 8;
    margin: 10px 0 12px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-md);
    background-color: #eef4f9;
    background-position: center;
    background-size: cover;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.65);
}

.banner-switch {
    display: inline-flex !important;
    align-items: center;
    grid-template-columns: none !important;
    width: fit-content;
    gap: 10px;
    color: var(--texto);
}

.banner-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.banner-switch span {
    width: 52px;
    height: 28px;
    position: relative;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #cfd8e3;
    box-shadow: inset 0 2px 5px rgba(0, 30, 70, 0.18);
    transition: background 0.2s ease;
}

.banner-switch span::after {
    content: "";
    width: 22px;
    height: 22px;
    position: absolute;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 30, 70, 0.22);
    transition: transform 0.2s ease;
}

.banner-switch input:checked + span {
    background: var(--azul);
}

.banner-switch input:checked + span::after {
    transform: translateX(24px);
}

.reto-admin-form {
    display: grid;
    gap: 16px;
}

.reto-switch,
.reto-reset {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reto-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.reto-switch span {
    width: 56px;
    height: 30px;
    position: relative;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #cfd8e3;
    box-shadow: inset 0 2px 5px rgba(0, 30, 70, 0.18);
    transition: background 0.2s ease;
}

.reto-switch span::after {
    content: "";
    width: 24px;
    height: 24px;
    position: absolute;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 30, 70, 0.22);
    transition: transform 0.2s ease;
}

.reto-switch input:checked + span {
    background: var(--azul);
}

.reto-switch input:checked + span::after {
    transform: translateX(26px);
}

.reto-reset input {
    width: auto;
}

.reto-count-control {
    display: grid;
    gap: 6px;
    max-width: 360px;
    color: var(--texto);
    font-weight: 700;
}

.reto-count-control input {
    width: min(100%, 160px);
    padding: 10px 12px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-md);
    background: #fff;
    color: var(--texto);
    font: inherit;
}

.reto-count-control small {
    color: var(--gris);
    font-weight: 500;
    line-height: 1.45;
}

.reto-preguntas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.reto-pregunta-card {
    min-width: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-lg);
    background: #f8fafc;
}

.reto-pregunta-card legend {
    padding: 0 8px;
    color: var(--azul-oscuro);
    font-weight: bold;
}

.reto-pregunta-card label,
.reto-opciones-grid {
    display: grid;
    gap: 6px;
}

.reto-opciones-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 10px 0;
}

@media (max-width: 640px) {
    .banner-global-setting {
        grid-template-columns: 1fr;
    }

    .reto-opciones-grid {
        grid-template-columns: 1fr;
    }
}

.reto-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: none !important;
    align-items: center;
    justify-content: center;
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 18px;
    overflow-y: auto;
    background: rgba(0, 32, 67, 0.58);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.reto-modal-overlay[hidden] {
    display: none !important;
}

.reto-modal-overlay.is-open {
    display: flex !important;
}

.reto-modal {
    width: min(560px, 100%);
    margin: auto;
    position: relative;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 26px;
    background: #fff;
    color: var(--texto);
    box-shadow: 0 28px 80px rgba(0, 30, 70, 0.28);
    animation: retoModalIn 0.22s ease-out both;
}

body.reto-modal-open {
    overflow: hidden;
}

.reto-modal-close {
    width: 40px;
    height: 40px;
    position: absolute;
    top: 14px;
    right: 14px;
    border: 0;
    border-radius: 50%;
    background: #edf3f8;
    color: var(--azul-oscuro);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.reto-modal-kicker {
    width: fit-content;
    margin: 0 0 10px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff3bf;
    color: #5b4600;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.reto-modal h2 {
    margin: 0 46px 12px 0;
    color: var(--azul-oscuro);
    font-size: 28px;
}

.reto-modal-pregunta {
    margin: 0 0 18px;
    color: #415264;
    font-size: 16px;
    line-height: 1.55;
}

.reto-modal-opciones {
    display: grid;
    gap: 10px;
}

.reto-modal-opciones button {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio-md);
    background: #f8fafc;
    color: var(--texto);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.reto-modal-opciones button:hover:not(:disabled) {
    border-color: var(--azul);
    background: #f1f7fc;
}

.reto-modal-opciones button:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.reto-modal-feedback {
    min-height: 20px;
    margin: 14px 0 0;
    font-size: 14px;
    font-weight: bold;
}

.reto-modal-feedback.is-success {
    color: #0b7a20;
}

.reto-modal-feedback.is-error {
    color: #a00000;
}

@keyframes retoModalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.levelup-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 4300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 204, 0, 0.24), transparent 36%),
        rgba(0, 32, 67, 0.72);
    backdrop-filter: blur(4px);
}

.levelup-modal-overlay.is-open {
    display: flex;
}

.levelup-modal {
    width: min(720px, 100%);
    padding: clamp(20px, 4vw, 34px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radio-lg);
    background:
        linear-gradient(135deg, #ffffff, #eef7ff);
    box-shadow: 0 30px 90px rgba(0, 20, 55, 0.36);
    text-align: center;
    animation: levelupIn 360ms ease-out;
}

.levelup-kicker {
    width: fit-content;
    margin: 0 auto 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff3bf;
    color: #5b4600;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.levelup-modal h2 {
    margin: 0 0 8px;
    color: var(--azul-oscuro);
    font-size: clamp(25px, 4vw, 38px);
}

.levelup-modal p {
    color: #526272;
}

.levelup-chests {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(8px, 1.6vw, 14px);
    margin: 22px 0;
}

.levelup-chest {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 124px;
    padding: 10px;
    border: 1px solid rgba(0, 85, 153, 0.18);
    border-radius: var(--radio-lg);
    background: #ffffff;
    box-shadow: var(--sombra-card);
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.levelup-chest:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(0, 85, 153, 0.18);
}

.levelup-chest:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.levelup-chest img {
    width: min(78px, 82%);
    aspect-ratio: 1;
    object-fit: contain;
    transition: transform 320ms ease;
}

.levelup-chest.is-open {
    border-color: var(--dorado);
    background: #fff9db;
    opacity: 1;
}

.levelup-chest.is-open img {
    transform: translateY(-8px) rotate(-5deg) scale(1.08);
}

.levelup-result {
    min-height: 24px;
    margin: 8px 0 0;
    font-weight: 800;
    color: var(--azul-oscuro);
}

.levelup-close {
    margin-top: 14px;
}

@keyframes levelupIn {
    from {
        transform: translateY(12px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@media (max-width: 520px) {
    .reto-modal {
        padding: 22px 16px;
    }

    .reto-modal h2 {
        font-size: 23px;
    }

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

@media (min-width: 1500px) {
    body > header,
    .top-header,
    .contenedor,
    .admin-layout,
    .layout {
        width: calc(100% - 72px);
    }

    body > header h1,
    .top-header h1 {
        font-size: 34px;
    }

    .layout {
        grid-template-columns: 320px minmax(0, 1fr) 360px;
    }

    .grid,
    .grid-tienda {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .right-panel {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
        gap: 14px;
    }

    .usuarios-card {
        grid-column: span 1;
    }
}

@media (max-width: 760px) {
    body > header,
    .top-header,
    .contenedor,
    .admin-layout,
    .layout {
        width: 100%;
        margin: 0;
        border-left: 0;
        border-right: 0;
    }

    body > header h1,
    .top-header h1 {
        font-size: 24px;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-avatar-img {
        width: 92px !important;
        height: 92px !important;
    }

    .layout,
    .grid,
    .grid-tienda,
    .form-crear-usuario,
    .right-panel {
        grid-template-columns: 1fr !important;
    }

    .contenedor,
    .admin-layout,
    .layout {
        padding: 14px;
    }

    .header-links a,
    .logout a,
    .btn,
    .btn-comprar,
    .btn-siguiente,
    .btn-finalizar,
    .btn-reintentar,
    .candado button {
        width: 100%;
    }

    .sidebar {
        order: 1;
    }

    .content {
        order: 2;
    }

    .right-panel {
        order: 3;
    }

    .page-activity {
        padding: 10px;
    }
}

/* Admin: responsive verified interface */
.page-admin {
    --admin-bg: #eef4f9;
    --admin-surface: #ffffff;
    --admin-surface-soft: #f7fafc;
    --admin-text: #172635;
    --admin-muted: #5c6b7a;
    --admin-border: #d6e0ea;
    --admin-primary: #003366;
    --admin-primary-2: #005599;
    --admin-success: #087a35;
    --admin-warning-bg: #fff6d6;
    --admin-warning-text: #604900;
    --admin-shadow: 0 1.125rem 2.75rem rgba(0, 30, 70, 0.12);
    min-width: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at top left, rgba(255, 204, 0, 0.16), transparent 24rem),
        linear-gradient(135deg, #eef4f9 0%, #f8fbfd 48%, #e7f0f8 100%);
    color: var(--admin-text);
}

.page-admin *,
.page-admin *::before,
.page-admin *::after {
    box-sizing: border-box;
}

.page-admin img,
.page-admin video,
.page-admin svg {
    max-width: 100%;
    height: auto;
}

.page-admin .admin-header {
    width: min(112rem, calc(100% - clamp(1rem, 4vw, 4.5rem))) !important;
    margin: clamp(0.75rem, 1.8vw, 1.5rem) auto 0 !important;
    padding: clamp(1rem, 2.4vw, 2rem) !important;
    border: 0.0625rem solid rgba(214, 224, 234, 0.85);
    border-radius: clamp(1.25rem, 2vw, 2rem);
    background:
        linear-gradient(135deg, rgba(0, 51, 102, 0.96), rgba(0, 85, 153, 0.9)),
        radial-gradient(circle at top right, rgba(255, 204, 0, 0.26), transparent 16rem);
    box-shadow: var(--admin-shadow);
}

.page-admin .admin-header-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(1rem, 3vw, 2.5rem);
    align-items: center;
    min-width: 0;
}

.page-admin .admin-identity {
    min-width: 0;
}

.page-admin .admin-eyebrow {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 0.55rem;
    padding: 0.4rem 0.7rem;
    border: 0.0625rem solid rgba(255, 255, 255, 0.25);
    border-radius: 999rem;
    background: rgba(255, 255, 255, 0.12);
    color: #ffe58a;
    font-size: clamp(0.72rem, 0.8vw, 0.82rem);
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.page-admin .admin-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
}

.page-admin .admin-title-row h1 {
    margin: 0 !important;
    color: #ffffff;
    font-size: clamp(1.7rem, 3.5vw, 3.6rem) !important;
    line-height: 1.04;
    overflow-wrap: anywhere;
}

.page-admin .admin-header p {
    max-width: 72ch;
    margin: 0.55rem 0 0 !important;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(0.9rem, 1.1vw, 1.05rem) !important;
    line-height: 1.55;
}

.page-admin .admin-session-note {
    margin-top: 0.25rem !important;
}

.page-admin .verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2rem;
    padding: 0.42rem 0.72rem;
    border: 0.0625rem solid rgba(124, 230, 164, 0.62);
    border-radius: 999rem;
    background: rgba(232, 247, 238, 0.16);
    color: #dfffea;
    font-size: clamp(0.8rem, 0.9vw, 0.92rem);
    font-weight: 800;
    white-space: nowrap;
    box-shadow: inset 0 0 0 0.0625rem rgba(255, 255, 255, 0.08);
}

.page-admin .verified-check {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 1.1rem;
    height: 1.1rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--admin-success);
}

.page-admin .verified-check::after {
    content: "";
    width: 0.36rem;
    height: 0.62rem;
    margin-top: -0.1rem;
    border-right: 0.13rem solid #ffffff;
    border-bottom: 0.13rem solid #ffffff;
    transform: rotate(45deg);
}

.page-admin .admin-header-actions {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin: 0 !important;
    min-width: 0;
}

.page-admin .admin-header-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.72rem 1rem;
    border: 0.0625rem solid rgba(255, 255, 255, 0.25);
    border-radius: 999rem;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff !important;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.page-admin .admin-header-actions a:hover,
.page-admin .admin-header-actions a:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

.page-admin .admin-layout {
    width: min(112rem, calc(100% - clamp(1rem, 4vw, 4.5rem))) !important;
    margin: 0 auto clamp(1rem, 3vw, 2rem) !important;
    padding: clamp(1rem, 2.5vw, 2rem) 0 !important;
    border: 0 !important;
}

.page-admin .mensaje {
    width: 100%;
    margin: 0 0 1rem !important;
    padding: 0.9rem 1rem !important;
    border-radius: 1rem !important;
    background: var(--admin-warning-bg) !important;
    color: var(--admin-warning-text) !important;
    border: 0.0625rem solid #ffe08a !important;
    font-size: 0.92rem !important;
    line-height: 1.45;
}

.page-admin .grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)) !important;
    gap: clamp(1rem, 2vw, 1.5rem) !important;
    align-items: start;
    min-width: 0;
}

.page-admin .card {
    min-width: 0;
    overflow: hidden;
    padding: clamp(1rem, 1.8vw, 1.35rem) !important;
    border: 0.0625rem solid var(--admin-border) !important;
    border-radius: 1.35rem !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--admin-text);
    box-shadow: 0 0.75rem 1.9rem rgba(0, 30, 70, 0.08) !important;
    gap: 0.85rem !important;
}

.page-admin .usuarios-card,
.page-admin .banner-admin-card {
    grid-column: span 2;
}

.page-admin .card h2 {
    margin: 0 0 0.35rem !important;
    color: var(--admin-primary) !important;
    font-size: clamp(1.08rem, 1.45vw, 1.45rem) !important;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.page-admin .card p,
.page-admin .card small,
.page-admin label,
.page-admin .lista-usuarios,
.page-admin .bonos-wrapper,
.page-admin .paginacion-usuarios {
    font-size: clamp(0.82rem, 0.95vw, 0.95rem) !important;
    line-height: 1.45;
}

.page-admin .card p {
    color: var(--admin-muted);
}

.page-admin .card small {
    color: #647384 !important;
}

.page-admin form,
.page-admin fieldset,
.page-admin label,
.page-admin .form-group,
.page-admin .campo {
    min-width: 0;
}

.page-admin .form-crear-usuario,
.page-admin .reto-opciones-grid,
.page-admin .banner-global-setting,
.page-admin .unidades-config-grid,
.page-admin .banner-slides-grid,
.page-admin .reto-preguntas-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)) !important;
}

.page-admin input,
.page-admin select,
.page-admin textarea {
    max-width: 100%;
    min-width: 0;
    min-height: 2.55rem;
    padding: 0.65rem 0.75rem !important;
    border: 0.0625rem solid var(--admin-border) !important;
    border-radius: 0.9rem !important;
    background: #ffffff;
    color: var(--admin-text);
    font-size: 0.92rem !important;
}

.page-admin input[type="checkbox"],
.page-admin input[type="radio"] {
    width: 1rem;
    min-width: 1rem;
    height: 1rem;
    min-height: 1rem;
    padding: 0 !important;
}

.page-admin input:focus,
.page-admin select:focus,
.page-admin textarea:focus {
    border-color: var(--admin-primary-2) !important;
    outline: 0.18rem solid rgba(0, 85, 153, 0.16);
}

.page-admin .btn {
    min-height: 2.65rem;
    max-width: 100%;
    padding: 0.72rem 1rem !important;
    border-radius: 999rem !important;
    background: var(--admin-primary-2) !important;
    color: #ffffff !important;
    font-size: 0.92rem !important;
    line-height: 1.2;
    white-space: normal;
}

.page-admin .btn:hover,
.page-admin .btn:focus-visible {
    background: var(--admin-primary) !important;
    outline: none;
}

.page-admin .lista-usuarios,
.page-admin .bonos-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.page-admin table {
    width: 100%;
    max-width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
}

.page-admin th,
.page-admin td {
    padding: 0.55rem 0.65rem !important;
    border-color: var(--admin-border) !important;
    overflow-wrap: anywhere;
}

.page-admin th {
    background: #edf4fb !important;
    color: var(--admin-primary);
}

.page-admin .acciones-tabla,
.page-admin .paginacion-usuarios {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.page-admin .personajes-opciones {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.25rem), 1fr)) !important;
    gap: 0.7rem !important;
}

.page-admin .personaje-card,
.page-admin .unidad-config-card,
.page-admin .banner-slide-card,
.page-admin .reto-pregunta-card {
    min-width: 0;
    border-radius: 1.15rem !important;
}

.page-admin .banner-preview {
    min-height: 8rem;
}

@media (min-width: 96rem) {
    .page-admin .grid {
        grid-template-columns: repeat(auto-fit, minmax(24rem, 1fr)) !important;
    }
}

@media (max-width: 64rem) {
    .page-admin .admin-header-content {
        grid-template-columns: 1fr;
    }

    .page-admin .admin-header-actions {
        justify-content: flex-start;
    }

    .page-admin .usuarios-card,
    .page-admin .banner-admin-card {
        grid-column: span 1;
    }
}

@media (max-width: 40rem) {
    .page-admin .admin-header,
    .page-admin .admin-layout {
        width: calc(100% - 1rem) !important;
    }

    .page-admin .admin-header {
        margin-top: 0.5rem !important;
        border-radius: 1.15rem;
    }

    .page-admin .admin-title-row {
        align-items: flex-start;
    }

    .page-admin .verified-badge {
        min-height: 1.8rem;
    }

    .page-admin .admin-header-actions,
    .page-admin .admin-header-actions a,
    .page-admin .acciones-tabla .btn {
        width: 100%;
    }

    .page-admin .grid,
    .page-admin .form-crear-usuario,
    .page-admin .reto-opciones-grid,
    .page-admin .banner-global-setting,
    .page-admin .unidades-config-grid,
    .page-admin .banner-slides-grid,
    .page-admin .reto-preguntas-grid {
        grid-template-columns: 1fr !important;
    }

    .page-admin .card {
        border-radius: 1.1rem !important;
    }
}

@media (prefers-color-scheme: dark) {
    .page-admin {
        --admin-bg: var(--gris-fondo);
        --admin-surface: var(--blanco);
        --admin-surface-soft: #f8fafc;
        --admin-text: var(--texto);
        --admin-muted: #617182;
        --admin-border: var(--gris-borde);
        --admin-warning-bg: #fff8dc;
        --admin-warning-text: #644b00;
        background:
            radial-gradient(circle at 10% 0%, rgba(255, 204, 0, 0.13), transparent 22rem),
            radial-gradient(circle at 92% 4%, rgba(15, 128, 189, 0.13), transparent 25rem),
            linear-gradient(135deg, #eceff3 0%, #f8fbfd 48%, #e7f0f8 100%);
    }

    .page-admin .card,
    .page-admin .unidad-config-card,
    .page-admin .banner-slide-card,
    .page-admin .reto-pregunta-card,
    .page-admin .actividad-config-list label,
    .page-admin .personaje-card {
        background: #ffffff !important;
        color: var(--admin-text) !important;
        border-color: var(--admin-border) !important;
    }

    .page-admin input,
    .page-admin select,
    .page-admin textarea {
        background: #ffffff;
        color: var(--admin-text);
        border-color: var(--admin-border) !important;
    }

    .page-admin th {
        background: #edf4fb !important;
        color: var(--azul-oscuro);
    }

    .page-admin tr:nth-child(even) {
        background: rgba(0, 85, 153, 0.035);
    }

    .page-admin .card h2,
    .page-admin .unidad-config-title,
    .page-admin .paginacion-usuarios a {
        color: var(--azul-oscuro) !important;
    }

    .page-admin .card p,
    .page-admin .card small {
        color: var(--admin-muted) !important;
    }
}

/* Admin: estilo de plataforma por recuadros */
.page-admin {
    --admin-bg: var(--gris-fondo);
    --admin-surface: var(--blanco);
    --admin-surface-soft: #f8fafc;
    --admin-text: var(--texto);
    --admin-muted: #617182;
    --admin-border: var(--gris-borde);
    --admin-primary: var(--azul-oscuro);
    --admin-primary-2: var(--azul);
    --admin-success: #0a8f4a;
    --admin-warning-bg: #fff8dc;
    --admin-warning-text: #644b00;
    --admin-shadow: var(--sombra-suave);
    min-height: 100vh;
    background: var(--gris-fondo) !important;
    color: var(--texto) !important;
}

.page-admin .admin-header {
    width: calc(100% - clamp(1rem, 3vw, 4.5rem)) !important;
    margin: clamp(0.5rem, 1.5vw, 1.5rem) auto 0 !important;
    padding: clamp(1rem, 2vw, 1.6rem) clamp(1rem, 3vw, 2.75rem) !important;
    background: var(--blanco) !important;
    border: 0.0625rem solid #d5dbe3 !important;
    border-top: 0.32rem solid var(--azul-oscuro) !important;
    border-radius: var(--radio-lg) var(--radio-lg) 0 0 !important;
    box-shadow: var(--sombra-suave) !important;
}

.page-admin .admin-header-content {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 1rem !important;
    align-items: center !important;
}

.page-admin .admin-eyebrow {
    display: inline-flex;
    margin-bottom: 0.35rem;
    color: var(--azul);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.page-admin .admin-title-row {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center !important;
}

.page-admin .admin-title-row h1 {
    margin: 0 !important;
    color: var(--azul-oscuro) !important;
    font-size: clamp(1.55rem, 2.3vw, 2.1rem) !important;
    line-height: 1.1;
}

.page-admin .admin-header p {
    max-width: 56rem;
    margin: 0.35rem 0 0 !important;
    color: #617182 !important;
    font-size: clamp(0.88rem, 1vw, 0.98rem) !important;
}

.page-admin .verified-badge {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    min-height: 1.85rem;
    padding: 0.25rem 0.65rem;
    border: 0.0625rem solid rgba(10, 143, 74, 0.25);
    border-radius: 999rem;
    background: rgba(10, 143, 74, 0.1);
    color: #08743e;
    font-size: 0.78rem;
    font-weight: 700;
}

.page-admin .verified-check {
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 50%;
    background: #0a8f4a;
    position: relative;
}

.page-admin .verified-check::after {
    content: "";
    position: absolute;
    left: 0.32rem;
    top: 0.2rem;
    width: 0.24rem;
    height: 0.48rem;
    border: solid #fff;
    border-width: 0 0.12rem 0.12rem 0;
    transform: rotate(45deg);
}

.page-admin .admin-header-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
}

.page-admin .admin-header-actions a,
.page-admin .btn {
    border-radius: 999rem !important;
    background: var(--azul) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.page-admin .admin-header-actions a:hover,
.page-admin .btn:hover {
    background: var(--azul-oscuro) !important;
}

.page-admin .admin-layout {
    width: calc(100% - clamp(1rem, 3vw, 4.5rem)) !important;
    max-width: 112rem;
    margin: 0 auto clamp(1.5rem, 3vw, 3rem) !important;
    padding: clamp(1rem, 2.2vw, 2.2rem) !important;
    background: var(--blanco) !important;
    border: 0.0625rem solid #d5dbe3 !important;
    border-top: 0 !important;
    border-radius: 0 0 var(--radio-lg) var(--radio-lg) !important;
    box-shadow: var(--sombra-suave) !important;
}

.page-admin .admin-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14.5rem), 1fr));
    gap: clamp(0.8rem, 1.4vw, 1.1rem);
    margin: 0 0 clamp(1rem, 2vw, 1.5rem);
}

.page-admin .admin-module-card {
    position: relative;
    display: grid;
    min-height: 9.2rem;
    gap: 0.45rem;
    align-content: start;
    padding: 1rem;
    overflow: hidden;
    border: 0.0625rem solid var(--gris-borde);
    border-top: 0.28rem solid var(--azul);
    border-radius: var(--radio-lg);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--sombra-card);
    color: var(--texto);
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.page-admin .admin-module-card span {
    width: fit-content;
    padding: 0.18rem 0.5rem;
    border-radius: 999rem;
    background: rgba(255, 204, 0, 0.22);
    color: #7a5b00;
    font-size: 0.78rem;
    font-weight: 700;
}

.page-admin .admin-module-card strong {
    color: var(--azul-oscuro);
    font-size: clamp(1rem, 1.2vw, 1.14rem);
    line-height: 1.2;
}

.page-admin .admin-module-card small {
    color: #617182;
    font-size: 0.86rem;
    line-height: 1.35;
}

.page-admin .admin-module-card:hover,
.page-admin .admin-module-card:focus-visible,
.page-admin .admin-module-card.is-active {
    transform: translateY(-0.12rem);
    border-color: var(--azul);
    box-shadow: 0 1rem 2rem rgba(0, 30, 70, 0.13);
    outline: none;
}

.page-admin .admin-module-card.is-active {
    border-top-color: var(--dorado);
}

.page-admin .grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
}

.page-admin .admin-section-card {
    scroll-margin-top: 1rem;
}

.page-admin .grid > .admin-section-card,
.page-admin .admin-legacy-card {
    display: none !important;
}

.page-admin.admin-modal-open {
    overflow: hidden !important;
}

.page-admin .admin-section-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    background: rgba(0, 32, 67, 0.64);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.page-admin .admin-section-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.page-admin .admin-section-modal {
    display: flex;
    flex-direction: column;
    width: min(1180px, 100%);
    max-height: calc(100vh - clamp(1.5rem, 4vw, 3rem));
    min-height: min(640px, calc(100vh - clamp(1.5rem, 4vw, 3rem)));
    overflow: hidden;
    border: 0.0625rem solid rgba(216, 221, 228, 0.92);
    border-radius: var(--radio-lg);
    background: #fff;
    box-shadow: 0 1.4rem 4rem rgba(0, 20, 50, 0.32);
    opacity: 0;
    transform: translateY(0.65rem) scale(0.985);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.page-admin .admin-section-modal-overlay.is-open .admin-section-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.page-admin .admin-section-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: clamp(0.9rem, 1.6vw, 1.25rem) clamp(1rem, 2vw, 1.5rem);
    border-bottom: 0.0625rem solid #dbe2ea;
    background: var(--azul);
    color: #fff;
}

.page-admin .admin-section-modal-header span {
    display: block;
    margin-bottom: 0.2rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-admin .admin-section-modal-header h2 {
    margin: 0;
    color: #fff !important;
    font-size: clamp(1.15rem, 1.8vw, 1.6rem);
    line-height: 1.15;
}

.page-admin .admin-section-modal-close {
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    border: 0.0625rem solid rgba(255, 255, 255, 0.48);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.page-admin .admin-section-modal-close:hover,
.page-admin .admin-section-modal-close:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    outline: none;
}

.page-admin .admin-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: clamp(0.9rem, 1.8vw, 1.4rem);
    background: #f5f8fb;
}

.page-admin .admin-modal-body > .admin-section-card {
    width: 100%;
    min-height: 100%;
    grid-column: auto !important;
    box-shadow: none !important;
}

.page-admin .admin-modal-body > .admin-section-card.is-active {
    display: flex !important;
    flex-direction: column;
}

.page-admin .admin-modal-body .lista-usuarios,
.page-admin .admin-modal-body .bonos-wrapper {
    max-height: none;
}

@media (prefers-reduced-motion: reduce) {
    .page-admin .admin-section-modal-overlay,
    .page-admin .admin-section-modal {
        transition: none;
    }
}

.page-admin .card {
    min-width: 0;
    padding: clamp(1rem, 2vw, 1.5rem) !important;
    border: 0.0625rem solid var(--gris-borde) !important;
    border-radius: var(--radio-lg) !important;
    background: var(--blanco) !important;
    color: var(--texto) !important;
    box-shadow: var(--sombra-card) !important;
}

.page-admin .card h2 {
    margin: 0 0 0.35rem !important;
    color: var(--azul-oscuro) !important;
    font-size: clamp(1.2rem, 1.6vw, 1.55rem) !important;
}

.page-admin .card p,
.page-admin .card small {
    color: #617182 !important;
}

.page-admin input,
.page-admin select,
.page-admin textarea {
    border: 0.0625rem solid #cfd8e3 !important;
    border-radius: var(--radio-sm) !important;
    background: #fff !important;
    color: var(--texto) !important;
}

.page-admin input:focus,
.page-admin select:focus,
.page-admin textarea:focus {
    border-color: var(--azul) !important;
    outline: 0.16rem solid rgba(0, 85, 153, 0.16) !important;
}

.page-admin .unidades-config-grid,
.page-admin .banner-slides-grid,
.page-admin .reto-preguntas-grid,
.page-admin .reto-opciones-grid,
.page-admin .form-crear-usuario {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)) !important;
}

.page-admin .unidad-config-card,
.page-admin .banner-slide-card,
.page-admin .reto-pregunta-card,
.page-admin .personaje-card {
    border: 0.0625rem solid var(--gris-borde) !important;
    border-radius: var(--radio-lg) !important;
    background: #f8fafc !important;
    box-shadow: 0 0.65rem 1.35rem rgba(0, 30, 70, 0.07) !important;
}

.page-admin .jefe-config-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 0.0625rem solid rgba(0, 85, 153, 0.16);
    border-radius: var(--radio-md);
    background: #eef6fc;
    color: var(--azul-oscuro);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.35;
}

.page-admin .actividad-config-list label {
    border: 0.0625rem solid #e1e7ee;
    background: #fff !important;
}

.page-admin .lista-usuarios,
.page-admin .bonos-wrapper {
    max-width: 100%;
    overflow-x: auto;
}

.page-admin th {
    background: #edf4fb !important;
    color: var(--azul-oscuro) !important;
}

@media (max-width: 52rem) {
    .page-admin .admin-header-content {
        grid-template-columns: 1fr !important;
    }

    .page-admin .admin-header-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 40rem) {
    .page-admin .admin-header,
    .page-admin .admin-layout {
        width: calc(100% - 1rem) !important;
    }

    .page-admin .admin-module-grid,
    .page-admin .unidades-config-grid,
    .page-admin .banner-slides-grid,
    .page-admin .reto-preguntas-grid,
    .page-admin .reto-opciones-grid,
    .page-admin .form-crear-usuario {
        grid-template-columns: 1fr !important;
    }

    .page-admin .admin-header-actions,
    .page-admin .admin-header-actions a,
    .page-admin .acciones-tabla .btn {
        width: 100%;
    }
}

/* Panel del estudiante: progreso y medallas */
.page-panel .header-left {
    align-items: stretch;
}

.page-panel .info-usuario {
    flex: 1 1 22rem;
}

.mis-medallas {
    flex: 0 1 24rem;
    min-width: min(100%, 17rem);
    padding: 0.9rem;
    border: 0.0625rem solid var(--gris-borde);
    border-radius: var(--radio-lg);
    background: #f8fafc;
    box-shadow: var(--sombra-card);
}

.mis-medallas-head {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}

.mis-medallas h2 {
    margin: 0;
    color: var(--azul-oscuro);
    font-size: 1rem;
}

#medallas-contador {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.7rem;
    height: 1.7rem;
    padding: 0 0.45rem;
    border-radius: 999rem;
    background: var(--azul);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.medallas-empty {
    margin: 0 0 0.65rem;
    color: #617182;
    font-size: 0.82rem;
    line-height: 1.35;
}

.medallas-lista {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.2rem;
    scrollbar-width: thin;
}

.medalla-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    max-width: 80px;
    padding: 0;
    border: 0.0625rem solid var(--gris-borde);
    border-radius: 1.25rem;
    background: #fff;
    color: var(--texto);
    font-size: 0.78rem;
    font-weight: 700;
}

.mis-medallas .medalla-texto {
    display: none;
}

.medalla-icono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #d8dde4;
    color: #617182;
    font-size: 1.15rem;
    font-weight: 800;
    box-shadow: inset 0 0 0 0.12rem rgba(255, 255, 255, 0.65);
}

.medalla-icono.has-image {
    width: 80px;
    height: 80px;
    overflow: hidden;
    background: transparent;
    color: transparent;
    box-shadow: none;
}

.medalla-icono.has-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0.2rem 0.35rem rgba(0, 51, 102, 0.25));
}

.medalla-chip.is-unlocked {
    border-color: rgba(220, 169, 0, 0.45);
    background: #fff8dc;
    color: #6f5200;
}

.medalla-chip.is-unlocked .medalla-icono {
    background: linear-gradient(145deg, #ffdf55, #dca900);
    color: #4f3900;
}

.medalla-chip.is-unlocked .medalla-icono.has-image {
    background: transparent;
}

.medalla-chip.is-unlocked .medalla-icono.has-image img {
    filter: drop-shadow(0 0 0.75rem rgba(0, 168, 232, 0.36));
}

.medalla-chip.is-special {
    border-color: rgba(0, 85, 153, 0.28);
    background: #eef6fc;
    color: var(--azul-oscuro);
}

.medalla-chip.is-special .medalla-icono {
    background: linear-gradient(145deg, var(--azul-claro), var(--azul-oscuro));
    color: #fff;
}

.medalla-chip.is-locked {
    opacity: 1;
    background: #f3f6f9;
    color: #7b8794;
}

.medalla-chip.is-locked .medalla-icono.has-image img {
    opacity: 0.22;
    filter: grayscale(1) saturate(0.2) brightness(0.72);
}

.curso-progreso {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.1rem;
    padding: clamp(1rem, 2vw, 1.4rem);
    border: 0.0625rem solid var(--gris-borde);
    border-radius: var(--radio-lg);
    background: #f8fafc;
    box-shadow: var(--sombra-card);
}

.progreso-general-head {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
}

.progreso-kicker {
    display: inline-flex;
    margin-bottom: 0.35rem;
    color: var(--azul);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.curso-progreso h2 {
    margin: 0;
    color: var(--azul-oscuro);
    font-size: clamp(1.2rem, 2vw, 1.65rem);
    line-height: 1.18;
}

.curso-progreso p {
    margin: 0.35rem 0 0;
    color: #617182;
    font-size: 0.92rem;
}

#progreso-porcentaje-grande {
    flex: 0 0 auto;
    padding: 0.45rem 0.7rem;
    border-radius: var(--radio-md);
    background: var(--azul-oscuro);
    color: #fff;
    font-size: clamp(1.25rem, 2vw, 1.8rem);
    line-height: 1;
}

.progreso-barra {
    width: 100%;
    min-height: 0.75rem;
    overflow: hidden;
    border-radius: 999rem;
    background: #dce5ef;
}

.progreso-barra span {
    display: block;
    min-height: inherit;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--azul), var(--azul-claro) 72%, var(--dorado));
    transition: width 0.28s ease;
}

.progreso-resumen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: 0.75rem;
}

.progreso-resumen-grid > div {
    padding: 0.8rem;
    border: 0.0625rem solid #dfe6ee;
    border-radius: var(--radio-md);
    background: #fff;
}

.progreso-resumen-grid span {
    display: block;
    margin-bottom: 0.2rem;
    color: #617182;
    font-size: 0.82rem;
}

.progreso-resumen-grid strong {
    color: var(--azul-oscuro);
    font-size: 1.1rem;
}

.progreso-unidades-lista {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 0.75rem;
}

.progreso-unidad-card {
    display: grid;
    gap: 0.6rem;
    padding: 0.85rem;
    border: 0.0625rem solid #dfe6ee;
    border-radius: var(--radio-md);
    background: #fff;
}

.progreso-unidad-card strong,
.progreso-unidad-card span {
    display: block;
}

.progreso-unidad-card strong {
    color: var(--azul-oscuro);
    font-size: 0.95rem;
}

.progreso-unidad-card span {
    margin-top: 0.2rem;
    color: #617182;
    font-size: 0.82rem;
}

.progreso-barra.unidad {
    min-height: 0.55rem;
}

.actividad-completar-box {
    display: grid;
    gap: 0.45rem;
    margin-top: 1rem;
    padding: 0.8rem;
    border: 0.0625rem solid var(--gris-borde);
    border-radius: var(--radio-md);
    background: #f8fafc;
}

.actividad-completar-feedback {
    min-height: 1.2rem;
    margin: 0;
    color: #617182;
    font-size: 0.85rem;
    font-weight: 700;
}

.actividad-iframe {
    width: 100%;
    height: min(86vh, 920px);
    border: 0;
    border-radius: var(--radio-lg);
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 30, 70, 0.16);
}

.actividad-panel-card {
    display: grid;
    gap: 1rem;
    padding: clamp(1rem, 2vw, 1.4rem);
    border: 0.0625rem solid var(--gris-borde);
    border-top: 0.3rem solid var(--azul-oscuro);
    border-radius: var(--radio-lg);
    background: #fff;
    box-shadow: var(--sombra-card);
}

.actividad-kicker {
    width: fit-content;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: #eaf3fb;
    color: var(--azul-oscuro);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.actividad-panel-card h2,
.actividad-panel-card p {
    margin: 0;
}

.actividad-panel-descripcion,
.actividad-instrucciones {
    color: #526272;
    line-height: 1.6;
}

.actividad-instrucciones {
    padding: 0.9rem;
    border: 0.0625rem solid #dfe6ee;
    border-radius: var(--radio-md);
    background: #f8fafc;
}

.actividad-instrucciones ol {
    margin: 0.65rem 0 0;
    padding-left: 1.2rem;
}

.actividad-simulador iframe {
    display: block;
    width: 100%;
    height: min(72vh, 680px);
    min-height: 420px;
    border: 0;
}

.actividad-grid-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: 0.8rem;
}

.actividad-mini-card,
.actividad-autoevaluacion {
    padding: 0.9rem;
    border: 0.0625rem solid #dfe6ee;
    border-radius: var(--radio-md);
    background: #f8fafc;
}

.actividad-mini-card h3 {
    margin: 0 0 0.35rem;
    color: var(--azul-oscuro);
}

.actividad-panel-choice {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem 0.85rem;
    border: 0.0625rem solid #cfd8e3;
    border-radius: var(--radio-md);
    background: #fff;
    color: var(--texto);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.actividad-panel-choice:hover,
.actividad-panel-choice.is-selected {
    border-color: var(--azul);
    background: #eaf3fb;
}

.actividad-panel-feedback {
    min-height: 1.2rem;
    margin: 0.7rem 0 0;
    color: var(--azul-oscuro);
    font-weight: 700;
    line-height: 1.5;
}

/* ============================================================
   Game Academy visual layer
   Moderniza actividades y jefes sin cambiar su logica PHP/JS.
   ============================================================ */

.game-enhanced.page-activity,
.game-enhanced.page-boss,
.game-enhanced.page-boss-u2 {
    position: relative;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 204, 0, 0.22), transparent 24rem),
        radial-gradient(circle at 88% 12%, rgba(15, 128, 189, 0.22), transparent 26rem),
        linear-gradient(135deg, #071c33 0%, #0a3158 45%, #eef4fb 45.2%, #f8fbff 100%) !important;
    background-attachment: fixed;
}

.game-enhanced.page-panel {
    background:
        radial-gradient(circle at 8% 10%, rgba(255, 204, 0, 0.14), transparent 22rem),
        radial-gradient(circle at 92% 0%, rgba(15, 128, 189, 0.14), transparent 24rem),
        var(--gris-fondo);
}

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

.game-particles span {
    width: var(--size);
    height: var(--size);
    position: absolute;
    left: var(--x);
    bottom: -2rem;
    border-radius: 50%;
    background: rgba(255, 204, 0, 0.42);
    box-shadow: 0 0 1rem rgba(255, 204, 0, 0.42);
    animation: game-float 9s linear infinite;
    animation-delay: var(--delay);
}

.game-enhanced > *:not(.game-particles):not(.game-burst) {
    position: relative;
    z-index: 1;
}

.game-enhanced .contenedor,
.game-enhanced .panel-escape,
.game-enhanced .u2-hero,
.game-enhanced .u2-game-card,
.game-enhanced .u3-hero,
.game-enhanced .u3-game,
.game-enhanced .boss-hero,
.game-enhanced .boss-arena,
.game-enhanced .boss-card,
.game-enhanced .card-examen,
.game-enhanced .actividad-panel-card {
    border: 1px solid rgba(255, 255, 255, 0.68) !important;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.95), rgba(245,249,253,0.9)) !important;
    box-shadow:
        0 1.4rem 3.2rem rgba(0, 30, 70, 0.2),
        inset 0 0 0 1px rgba(255,255,255,0.54) !important;
    transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.game-enhanced .u2-hero,
.game-enhanced .u3-hero,
.game-enhanced .boss-hero,
.game-enhanced .page-activity h1,
.game-enhanced body > header {
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(0, 51, 102, 0.96), rgba(0, 85, 153, 0.86)),
        radial-gradient(circle at 88% 14%, rgba(255, 204, 0, 0.28), transparent 17rem) !important;
    color: #fff !important;
}

.game-enhanced .u2-hero h1,
.game-enhanced .u2-hero p,
.game-enhanced .u3-hero h1,
.game-enhanced .u3-hero p,
.game-enhanced .boss-hero h1,
.game-enhanced .boss-hero p,
.game-enhanced.page-activity h1,
.game-enhanced body > header h1,
.game-enhanced body > header p {
    color: #fff !important;
}

.game-enhanced .u2-hero::after,
.game-enhanced .u3-hero::after,
.game-enhanced .boss-hero::after,
.game-enhanced.page-activity h1::after {
    content: "";
    width: 17rem;
    height: 17rem;
    position: absolute;
    right: -5rem;
    top: -5rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.26);
    box-shadow:
        inset 0 0 2.6rem rgba(255, 255, 255, 0.18),
        0 0 4rem rgba(255, 204, 0, 0.18);
    pointer-events: none;
}

.game-enhanced .mision,
.game-enhanced .candado,
.game-enhanced .pregunta,
.game-enhanced .u2-level,
.game-enhanced .u2-card,
.game-enhanced .u3-choice,
.game-enhanced .boss-option,
.game-enhanced .actividad-mini-card,
.game-enhanced .actividad-autoevaluacion,
.game-enhanced .actividad-completar-box {
    border-color: rgba(0, 85, 153, 0.22) !important;
    background:
        linear-gradient(180deg, #ffffff, #f6fbff) !important;
    box-shadow: 0 0.75rem 1.8rem rgba(0, 30, 70, 0.08) !important;
}

.game-enhanced .mision h3,
.game-enhanced .candado h2,
.game-enhanced .pregunta strong,
.game-enhanced .actividad-panel-card h2 {
    color: var(--azul-oscuro);
}

.game-enhanced button,
.game-enhanced .btn,
.game-enhanced .boss-btn,
.game-enhanced .btn-siguiente,
.game-enhanced .btn-finalizar,
.game-enhanced .btn-reintentar,
.game-enhanced .actividad-panel-choice {
    position: relative;
    overflow: hidden;
    box-shadow: 0 0.55rem 1.1rem rgba(0, 85, 153, 0.16);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.game-enhanced button:hover,
.game-enhanced .btn:hover,
.game-enhanced .boss-btn:hover,
.game-enhanced .actividad-panel-choice:hover {
    transform: translateY(-0.08rem);
    box-shadow: 0 0.8rem 1.45rem rgba(0, 85, 153, 0.22);
}

.game-ripple {
    width: 0.7rem;
    height: 0.7rem;
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.72);
    transform: translate(-50%, -50%) scale(0);
    animation: game-ripple 0.62s ease-out;
    pointer-events: none;
}

.game-burst {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    pointer-events: none;
}

.game-burst span {
    width: 0.45rem;
    height: 0.45rem;
    position: absolute;
    border-radius: 50%;
    background: var(--dorado);
    box-shadow: 0 0 0.75rem rgba(255, 204, 0, 0.6);
    animation: game-burst 0.72s ease-out forwards;
}

.game-burst.is-bad span {
    background: #ff715b;
    box-shadow: 0 0 0.75rem rgba(255, 113, 91, 0.65);
}

.game-pop {
    animation: game-pop 0.35s ease;
}

.game-enhanced .life-bar,
.game-enhanced .u2-progress-track,
.game-enhanced .u3-progress,
.game-enhanced .barra-progreso,
.game-enhanced .progreso-barra {
    position: relative;
    overflow: hidden;
}

.game-enhanced .life-bar::after,
.game-enhanced .u2-progress-track::after,
.game-enhanced .u3-progress::after,
.game-enhanced .barra-progreso::after,
.game-enhanced .progreso-barra::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.46), transparent);
    transform: translateX(-100%);
    animation: game-scan 2.8s ease-in-out infinite;
    pointer-events: none;
}

.game-enhanced .medalla-chip {
    min-height: 2.55rem;
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.88), rgba(239,246,255,0.78));
    box-shadow: 0 0.5rem 1.2rem rgba(0, 30, 70, 0.12);
}

.game-enhanced .medalla-chip.is-unlocked .medalla-icono {
    background:
        radial-gradient(circle at 35% 25%, #fff8bf, #ffcc00 48%, #c89100 100%);
    color: #3a2a00;
    box-shadow: 0 0 1rem rgba(255, 204, 0, 0.5);
}

.game-enhanced .medalla-chip .medalla-icono.has-image,
.game-enhanced .medalla-chip.is-unlocked .medalla-icono.has-image,
.game-enhanced .medalla-chip.is-special .medalla-icono.has-image,
.game-enhanced .medalla-chip.is-locked .medalla-icono.has-image {
    background: transparent;
    box-shadow: none;
}

.game-enhanced .medalla-chip.is-special .medalla-icono {
    background:
        radial-gradient(circle at 35% 25%, #dff8ff, #4dc5ff 45%, #005599 100%);
    color: #fff;
}

.game-enhanced .medalla-chip.is-locked .medalla-icono {
    background: linear-gradient(135deg, #d8dde4, #aab4c0);
    color: #526272;
}

.game-reward-widget {
    display: grid;
    grid-template-columns: 4.6rem minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    background:
        linear-gradient(135deg, #ffffff, #eef7ff) !important;
}

.game-reward-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.game-reward-content .progreso-barra {
    width: 100%;
}

.game-reward-widget p {
    margin: 0.2rem 0 0.5rem;
    color: #617182;
    font-size: 0.82rem;
}

.game-reward-widget small {
    display: block;
    color: #617182;
    font-size: 0.75rem;
}

.game-reward-widget #premio-pendiente-text {
    margin-top: 0.52rem;
    line-height: 1.35;
}

.premio-reclamo-slot:empty {
    display: none;
}

.btn-reclamar-premio {
    width: auto;
    min-width: 10.5rem;
    margin-top: 0.48rem;
    padding-inline: 1rem;
    background: var(--azul);
    color: #ffffff;
    box-shadow: 0 0.55rem 1.1rem rgba(0, 85, 153, 0.16);
    align-self: flex-start;
}

.btn-reclamar-premio:not(:disabled) {
    background: var(--azul);
    color: #ffffff;
}

.btn-reclamar-premio:hover:not(:disabled) {
    transform: translateY(-1px);
    background: var(--azul-oscuro);
    box-shadow: 0 0.75rem 1.35rem rgba(0, 85, 153, 0.22);
}

.btn-reclamar-premio:disabled {
    cursor: not-allowed;
    background: #c6ced8;
    color: #5d6b78;
    opacity: 1;
    box-shadow: none;
}

.btn-reclamar-premio:disabled:hover {
    background: #c6ced8;
    color: #5d6b78;
    transform: none;
    box-shadow: none;
}

.premio-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 2147483100 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    padding: 1.2rem;
    margin: 0 !important;
    overflow-y: auto;
    background:
        radial-gradient(circle at 50% 22%, rgba(255, 204, 0, 0.22), transparent 18rem),
        radial-gradient(circle at 18% 88%, rgba(0, 102, 179, 0.25), transparent 18rem),
        rgba(0, 20, 45, 0.76);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}

.premio-modal-overlay[hidden] {
    display: none !important;
}

.premio-modal-overlay.is-open {
    display: flex !important;
}

body.premio-modal-open {
    overflow: hidden;
}

body.u1-match-modal-open {
    overflow: hidden;
}

.u1-activity-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483200 !important;
}

.premio-modal.u1-activity-modal {
    width: min(74rem, calc(100vw - 1rem));
    height: min(54rem, calc(100vh - 1rem));
    height: min(54rem, calc(100dvh - 1rem));
    padding: clamp(0.55rem, 1.4vw, 0.85rem);
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: left;
    overflow: hidden;
}

.premio-modal.u1-activity-modal::before {
    display: none;
}

.u1-activity-modal .u1-match-kicker,
.u1-activity-modal > h2,
.u1-activity-modal > .premio-modal-intro {
    display: none;
}

.u1-activity-frame-wrap {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #dce8f3;
    border-radius: var(--radio-lg);
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 1rem 2.2rem rgba(0, 51, 102, 0.14);
}

.u1-activity-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #ffffff;
}

@media (max-width: 720px) {
    .premio-modal.u1-activity-modal {
        width: calc(100vw - 0.75rem);
        height: calc(100vh - 0.75rem);
        height: calc(100dvh - 0.75rem);
        padding: 0.45rem;
        border-radius: 1.25rem;
    }

    .u1-activity-frame-wrap {
        border-radius: 1rem;
    }
}

.u1-match-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    padding: clamp(0.75rem, 3vw, 1.5rem);
    overflow-y: auto;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 204, 0, 0.16), transparent 20rem),
        radial-gradient(circle at 14% 82%, rgba(15, 128, 189, 0.22), transparent 22rem),
        var(--bg-overlay);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.u1-match-modal-overlay[hidden] {
    display: none !important;
}

.u1-match-modal-overlay.is-open {
    display: flex !important;
}

.u1-match-modal {
    position: relative;
    width: min(58rem, 100%);
    margin: auto;
    padding: clamp(1.1rem, 3vw, 1.75rem);
    border: 1px solid rgba(255, 255, 255, 0.74);
    border-radius: var(--radio-lg);
    background:
        linear-gradient(135deg, var(--bg-modal), rgba(236, 247, 255, 0.96)),
        radial-gradient(circle at top, rgba(255, 204, 0, 0.18), transparent 26rem);
    color: var(--texto);
    font-family: var(--fuente-principal);
    box-shadow: 0 2rem 5rem rgba(0, 21, 51, 0.4), inset 0 1px 0 rgba(255,255,255,0.8);
    animation: u1MatchModalIn 300ms cubic-bezier(.2,.9,.25,1.12);
}

@keyframes u1MatchModalIn {
    from {
        opacity: 0;
        transform: translateY(0.6rem) scale(0.975);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.u1-match-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 2.35rem;
    height: 2.35rem;
    border: 0;
    border-radius: 999px;
    background: #e7eef7;
    color: var(--color-primario);
    cursor: pointer;
    font: inherit;
    font-size: 1.35rem;
    font-weight: 900;
    box-shadow: 0 0.65rem 1.2rem rgba(0, 51, 102, 0.12);
}

.u1-match-kicker {
    width: fit-content;
    margin: 0 0 0.65rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 204, 0, 0.22);
    color: #594400;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.u1-match-modal h2 {
    margin: 0 2.4rem 0.45rem 0;
    color: var(--color-primario);
    font-size: clamp(1.45rem, 3vw, 2.25rem);
}

.u1-match-intro {
    max-width: 48rem;
    margin: 0 0 1rem;
    color: #516272;
    line-height: 1.55;
}

.u1-match-status {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.7rem;
}

.u1-match-status span {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #eef6fd;
    color: var(--color-primario);
    font-weight: 800;
}

.u1-match-progress {
    height: 0.6rem;
    overflow: hidden;
    border-radius: 999px;
    background: #dce8f3;
    margin-bottom: 1rem;
}

.u1-match-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-secundario), var(--color-acento));
    transition: width 220ms ease;
}

.u1-match-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.8rem, 2vw, 1rem);
}

.u1-match-column {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

.u1-match-column h3 {
    margin: 0;
    color: var(--color-primario);
    font-size: 1rem;
}

.u1-match-list {
    display: grid;
    gap: 0.65rem;
}

.u1-match-card {
    width: 100%;
    min-height: 4.25rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid #d6e5f2;
    border-radius: var(--radio-md);
    background: rgba(255, 255, 255, 0.88);
    color: var(--texto);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.35;
    text-align: left;
    box-shadow: 0 0.7rem 1.5rem rgba(0, 51, 102, 0.07);
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.u1-match-card:hover:not(:disabled) {
    background: #f0f8ff;
    border-color: rgba(15, 128, 189, 0.55);
    box-shadow: 0 0.9rem 1.8rem rgba(0, 85, 153, 0.12);
}

.u1-match-card.active {
    border-color: var(--color-secundario);
    background: #e7f4ff;
    box-shadow: 0 0 0 3px rgba(15, 128, 189, 0.14);
}

.u1-match-card.correct {
    border-color: #2c9d57;
    background: #ecfff3;
    color: #155d2f;
}

.u1-match-card.incorrect {
    border-color: #c94141;
    background: #fff1f1;
    color: #8a1f1f;
}

.u1-match-card:disabled {
    cursor: default;
    opacity: 0.82;
}

.u1-match-feedback {
    min-height: 1.5rem;
    margin: 0.9rem 0 0;
    color: var(--color-primario);
    font-weight: 800;
}

.u1-match-feedback.is-error {
    color: #9c2424;
}

.u1-match-feedback.is-success {
    color: #176733;
}

.u1-match-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.u1-match-register {
    background: var(--color-secundario);
    color: #ffffff;
}

.u1-match-register[hidden] {
    display: none !important;
}

.u1-match-flip-modal {
    width: min(70rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
}

.u1-match-flip-modal .u1-match-kicker {
    display: none;
}

.u1-match-flip-modal h2 {
    margin-right: 2.8rem;
}

.u1-match-flip-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(0.55rem, 1.4vw, 0.85rem);
}

.u1-match-flip-card {
    min-height: clamp(6.4rem, 13vh, 8.2rem);
    position: relative;
    padding: 0;
    border: 0;
    border-radius: 1.25rem;
    background: transparent;
    perspective: 900px;
    box-shadow: none;
    text-align: center;
}

.u1-match-flip-card:hover:not(:disabled) {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.u1-match-flip-card.active,
.u1-match-flip-card.correct,
.u1-match-flip-card.incorrect {
    background: transparent;
    box-shadow: none;
}

.u1-match-flip-card .match-inner {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    transform-style: preserve-3d;
    transition: transform 0.38s ease;
    pointer-events: none;
}

.u1-match-flip-card.is-open .match-inner,
.u1-match-flip-card.correct .match-inner {
    transform: rotateY(180deg);
}

.u1-match-flip-card .match-face {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 0.8rem;
    border: 1px solid #d6e5f2;
    border-radius: inherit;
    backface-visibility: hidden;
    box-shadow: 0.55rem 0.55rem 1.2rem rgba(0, 30, 70, 0.08), -0.45rem -0.45rem 1rem rgba(255,255,255,0.92);
}

.u1-match-flip-card .match-front {
    background: linear-gradient(135deg, #f7fbff, #e5f0fb);
    color: var(--color-primario);
    font-size: clamp(1.35rem, 2.2vw, 1.8rem);
    font-weight: 900;
}

.u1-match-flip-card .match-back {
    transform: rotateY(180deg);
    background: #ffffff;
    color: var(--texto);
    font-size: clamp(0.72rem, 1.2vw, 0.92rem);
    line-height: 1.25;
}

.u1-match-flip-card .match-back small {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--color-secundario);
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.u1-match-flip-card .match-back strong {
    display: block;
}

.u1-match-flip-card .formula {
    display: inline-block;
    max-width: 100%;
    padding: 0.28rem 0.45rem;
    border-radius: 0.75rem;
    background: rgba(255, 204, 0, 0.13);
    color: var(--color-primario);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    line-height: 1.25;
}

.u1-match-flip-card .formula.big {
    min-height: 2.35rem;
    padding: 0.4rem 0.65rem;
    font-size: 1rem;
}

.u1-match-flip-card .formula sub,
.u1-match-flip-card .formula sup {
    font-size: 0.68em;
    line-height: 0;
}

.u1-match-flip-card .frac {
    display: inline-grid;
    grid-template-rows: auto auto;
    place-items: center;
    min-width: 2.2em;
    margin: 0 0.12em;
    vertical-align: middle;
}

.u1-match-flip-card .frac .top {
    width: 100%;
    padding: 0 0.25em 0.08em;
    border-bottom: 2px solid currentColor;
    text-align: center;
}

.u1-match-flip-card .frac .bottom {
    padding: 0.08em 0.25em 0;
    text-align: center;
}

.u1-match-flip-card.active .match-face {
    border-color: var(--color-secundario);
    box-shadow: 0 0 0 3px rgba(15, 128, 189, 0.14), 0 1rem 2rem rgba(0, 85, 153, 0.12);
}

.u1-match-flip-card.correct .match-back {
    border-color: #2c9d57;
    background: #ecfff3;
    color: #155d2f;
}

.u1-match-flip-card.incorrect .match-back {
    border-color: #c94141;
    background: #fff1f1;
    color: #8a1f1f;
}

@media (max-width: 720px) {
    .u1-match-board {
        grid-template-columns: 1fr;
    }

    .u1-match-modal {
        max-height: calc(100dvh - 1.5rem);
        overflow-y: auto;
    }

    .u1-match-flip-modal {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }

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

.premio-modal {
    position: relative;
    width: min(46rem, 100%);
    margin: auto;
    padding: clamp(1.25rem, 4vw, 2rem);
    border-radius: var(--radio-lg);
    border: 1px solid rgba(255, 255, 255, 0.68);
    background:
        linear-gradient(135deg, rgba(255,255,255,0.96), rgba(229,244,255,0.95)),
        radial-gradient(circle at top, rgba(255, 204, 0, 0.24), transparent 22rem);
    box-shadow: 0 2.4rem 6rem rgba(0, 15, 45, 0.44), inset 0 1px 0 rgba(255,255,255,0.75);
    text-align: center;
    overflow: hidden;
    animation: premioModalIn 360ms cubic-bezier(.2,.9,.25,1.18);
}

.premio-modal::before {
    content: "";
    position: absolute;
    inset: -35% -10% auto;
    height: 14rem;
    background: radial-gradient(circle, rgba(255, 204, 0, 0.28), transparent 64%);
    pointer-events: none;
}

.premio-modal-kicker {
    position: relative;
    width: fit-content;
    margin: 0 auto 0.65rem;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #fff4ba, #ffd45c);
    color: #4d3900;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    box-shadow: 0 0.7rem 1.4rem rgba(128, 96, 0, 0.14);
}

.premio-modal h2 {
    position: relative;
    margin: 0 0 0.9rem;
    color: var(--azul-oscuro);
    font-size: clamp(1.65rem, 4.2vw, 2.65rem);
    line-height: 1.05;
}

.premio-modal-intro {
    position: relative;
    max-width: 36rem;
    margin: 0 auto;
    color: #4d6376;
    line-height: 1.55;
}

.premio-modal-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 51, 102, 0.1);
    color: var(--azul-oscuro);
    font-size: 1.25rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease;
}

.premio-modal-close:hover {
    transform: scale(1.06);
    background: rgba(0, 85, 153, 0.16);
}

.premio-chests {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(0.55rem, 1.8vw, 0.85rem);
    margin: 1.35rem 0 0.85rem;
}

.premio-chests.is-locked .premio-chest:not(.is-opening):not(.is-open):not(.is-error) {
    opacity: 0.45;
}

.premio-chest {
    display: grid;
    place-items: center;
    gap: 0.45rem;
    min-height: 7.7rem;
    padding: 0.65rem;
    border: 1px solid rgba(255, 204, 0, 0.35);
    border-radius: var(--radio-lg);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(232,246,255,0.96)),
        radial-gradient(circle at top, rgba(255, 204, 0, 0.18), transparent 75%);
    color: var(--azul-oscuro);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 1rem 2rem rgba(0, 42, 86, 0.15), inset 0 1px 0 rgba(255,255,255,0.8);
    transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
    animation: premioChestFloat 2.8s ease-in-out infinite;
}

.premio-chest:nth-child(2) { animation-delay: 120ms; }
.premio-chest:nth-child(3) { animation-delay: 240ms; }
.premio-chest:nth-child(4) { animation-delay: 360ms; }
.premio-chest:nth-child(5) { animation-delay: 480ms; }

.premio-chest:hover:not(:disabled) {
    animation: none;
    transform: translateY(-0.45rem) scale(1.035);
    border-color: var(--dorado);
    box-shadow: 0 1.25rem 2.4rem rgba(0, 42, 86, 0.22), 0 0 0 0.2rem rgba(255, 204, 0, 0.14);
}

.premio-chest:disabled {
    pointer-events: none;
    cursor: not-allowed;
    animation-play-state: paused;
}

.premio-chest img {
    width: min(5rem, 88%);
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 0.55rem 0.7rem rgba(0, 30, 70, 0.18));
}

.premio-chest.is-opening {
    border-color: var(--dorado);
    background: linear-gradient(180deg, #fff7ce, #dff3ff);
    animation: premioChestShake 680ms ease-in-out infinite;
}

.premio-chest.is-open {
    opacity: 1;
    border-color: var(--dorado);
    background: linear-gradient(180deg, #fff1a8, #e9f8ff);
    transform: translateY(-0.25rem) scale(1.05);
    box-shadow: 0 1.5rem 3rem rgba(0, 42, 86, 0.24), 0 0 2rem rgba(255, 204, 0, 0.38);
}

.premio-chest.is-error {
    opacity: 1;
    border-color: #b00020;
    background: #fff1f3;
}

.premio-resultado[hidden] {
    display: none !important;
}

.premio-resultado {
    position: relative;
    display: grid;
    justify-items: center;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid rgba(255, 204, 0, 0.42);
    border-radius: var(--radio-lg);
    background: rgba(255, 255, 255, 0.82);
    overflow: hidden;
}

.premio-resultado.is-visible {
    animation: premioReveal 520ms ease-out both;
}

.premio-particles,
.premio-particles::before,
.premio-particles::after {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 38%, rgba(255, 204, 0, 0.9) 0 0.12rem, transparent 0.14rem),
        radial-gradient(circle at 72% 26%, rgba(0, 102, 179, 0.75) 0 0.1rem, transparent 0.12rem),
        radial-gradient(circle at 84% 72%, rgba(255, 255, 255, 0.92) 0 0.12rem, transparent 0.14rem),
        radial-gradient(circle at 32% 78%, rgba(132, 80, 255, 0.75) 0 0.1rem, transparent 0.12rem);
    animation: premioSparkle 1.35s ease-out infinite;
}

.premio-particles::before {
    transform: rotate(18deg) scale(0.88);
    animation-delay: 160ms;
}

.premio-particles::after {
    transform: rotate(-14deg) scale(1.06);
    animation-delay: 320ms;
}

.premio-result-img {
    width: min(8rem, 55vw);
    aspect-ratio: 1;
    object-fit: contain;
    margin: 0 auto 0.85rem;
    border-radius: 1.2rem;
    background: #ffffff;
    box-shadow: var(--sombra-card);
}

.premio-modal-nombre {
    margin: 0;
    color: var(--azul-oscuro);
    font-size: 1.15rem;
    font-weight: 900;
}

.premio-modal-descripcion {
    margin: 0.45rem 0 1rem;
    color: #526272;
    line-height: 1.5;
}

.premio-modal-feedback {
    min-height: 1.3rem;
    margin: 0.6rem 0 0;
    color: var(--azul-oscuro);
    font-weight: 800;
}

.resultado-final-modal {
    width: min(36rem, calc(100vw - 2rem));
    text-align: center;
}

.resultado-final-modal.is-loss {
    box-shadow: 0 1.4rem 4rem rgba(120, 28, 36, 0.22);
}

.resultado-final-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.1rem 0 0.6rem;
}

.resultado-final-stat {
    border: 1px solid rgba(0, 102, 179, 0.16);
    border-radius: 1rem;
    padding: 0.8rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 248, 255, 0.88));
    box-shadow: 0 0.8rem 1.7rem rgba(0, 51, 102, 0.08);
}

.resultado-final-stat span {
    display: block;
    color: #5b6b7a;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.resultado-final-stat strong {
    display: block;
    margin-top: 0.25rem;
    color: var(--azul-oscuro);
    font-size: clamp(1.15rem, 3vw, 1.55rem);
    font-weight: 900;
}

@media (max-width: 34rem) {
    .resultado-final-stats {
        grid-template-columns: 1fr;
    }
}

.premio-modal-accept {
    margin-top: 0.9rem;
    background: linear-gradient(135deg, var(--azul), var(--azul-oscuro));
    box-shadow: 0 0.9rem 1.8rem rgba(0, 85, 153, 0.22);
}

.premio-modal-accept[hidden] {
    display: none !important;
}

@keyframes premioModalIn {
    from {
        opacity: 0;
        transform: translateY(1rem) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes premioChestFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-0.22rem);
    }
}

@keyframes premioChestShake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    25% {
        transform: translateX(-0.08rem) rotate(-1.8deg);
    }
    75% {
        transform: translateX(0.08rem) rotate(1.8deg);
    }
}

@keyframes premioReveal {
    from {
        opacity: 0;
        transform: scale(0.92);
        filter: brightness(1.4);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes premioSparkle {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.92);
    }
    35% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-1.2rem) scale(1.08);
    }
}

@media (max-width: 560px) {
    .premio-chests {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.game-reward-widget.is-updating {
    animation: xpWidgetPulse 680ms ease-out;
}

.game-reward-widget.is-updating #xp-total,
.game-reward-widget.is-updating #xp-progress-text {
    color: #005599;
}

@keyframes xpWidgetPulse {
    0% {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 0 rgba(255, 204, 0, 0);
    }
    35% {
        transform: translateY(-2px) scale(1.015);
        box-shadow: 0 0 0 0.32rem rgba(255, 204, 0, 0.22);
    }
    100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 0 rgba(255, 204, 0, 0);
    }
}

.game-chest {
    width: 4.35rem;
    aspect-ratio: 1;
    position: relative;
    border-radius: 1rem;
    background:
        linear-gradient(180deg, #ffdd57 0 42%, #c89100 43% 100%);
    box-shadow:
        inset 0 0 0 0.18rem rgba(255,255,255,0.35),
        0 0.65rem 1.4rem rgba(0, 30, 70, 0.18),
        0 0 1.4rem rgba(255, 204, 0, 0.36);
}

.game-chest::before {
    content: "";
    position: absolute;
    inset: 0.75rem 0.4rem auto;
    height: 0.6rem;
    border-radius: 999px;
    background: #003366;
    box-shadow: 0 1.55rem 0 #003366;
}

.game-chest::after {
    content: "";
    width: 1rem;
    height: 1rem;
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    background: #0f80bd;
    box-shadow: 0 0 0.8rem rgba(15, 128, 189, 0.68);
    transform: translate(-50%, -50%);
}

.game-level-icon {
    width: 4.35rem;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 1rem;
    border: 0.0625rem solid rgba(0, 85, 153, 0.18);
    background:
        radial-gradient(circle at 50% 42%, rgba(0, 168, 232, 0.2), transparent 58%),
        linear-gradient(145deg, #ffffff, #eaf4fb);
    box-shadow:
        inset 0 0.0625rem 0 rgba(255, 255, 255, 0.95),
        0 0.65rem 1.4rem rgba(0, 30, 70, 0.14),
        0 0 1rem rgba(0, 168, 232, 0.16);
    overflow: hidden;
}

.game-level-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.game-level-icon span {
    color: var(--azul-oscuro);
    font-size: 1.38rem;
    font-weight: 950;
    letter-spacing: 0;
}

.mission-launch-card {
    display: grid;
    grid-template-columns: minmax(6rem, 9rem) minmax(0, 1fr);
    gap: clamp(1rem, 2vw, 1.5rem);
    align-items: center;
    padding: clamp(1rem, 2.4vw, 1.5rem);
    border: 0.0625rem solid rgba(0, 85, 153, 0.2);
    border-radius: var(--radio-lg);
    background:
        linear-gradient(135deg, #ffffff, #eef7ff);
    box-shadow: var(--sombra-card);
}

.mission-launch-card h2,
.mission-launch-card p {
    margin: 0;
}

.mission-launch-card p {
    margin-top: 0.45rem;
    color: #526272;
    line-height: 1.55;
}

.mission-launch-orb {
    width: min(8rem, 100%);
    aspect-ratio: 1;
    border-radius: 28%;
    background:
        radial-gradient(circle at 35% 28%, #fff7bf 0 10%, #ffcc00 11% 25%, #0f80bd 26% 58%, #003366 59% 100%);
    box-shadow: 0 0 2rem rgba(15, 128, 189, 0.38), 0 0 1.4rem rgba(255, 204, 0, 0.42);
}

.mission-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.8rem 0 1rem;
}

.mission-tags span {
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: #eaf3fb;
    color: var(--azul-oscuro);
    font-size: 0.78rem;
    font-weight: 800;
}

.mission-launch-btn {
    width: fit-content;
}

.boss-preview-bars {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(9rem, auto);
    gap: 0.8rem;
    align-items: center;
    margin: 1rem 0;
}

.boss-preview-bars p {
    margin: 0.25rem 0 0;
    font-weight: 800;
    color: var(--azul-oscuro);
}

.boss-launch-card-u1,
.boss-launch-card-u1:hover,
.boss-launch-card-u1:focus-within {
    transform: none !important;
}

.boss-launch-card-u1 .game-boss-core,
.boss-launch-card-u1:hover .game-boss-core,
.boss-launch-card-u1:focus-within .game-boss-core {
    transform: none !important;
}

.boss-launch-card-u1 .mission-launch-btn:hover,
.boss-launch-card-u1 .mission-launch-btn:focus-visible {
    transform: none !important;
}

.native-mission {
    overflow: hidden;
}

.native-mission-hud {
    display: grid;
    gap: 0.5rem;
    padding: 0.85rem;
    border: 0.0625rem solid #dfe6ee;
    border-radius: var(--radio-md);
    background: #f8fafc;
}

.native-mission-grid,
.native-lock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: 0.85rem;
}

.native-node {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
    padding: 0.9rem;
    border: 0.0625rem solid #dfe6ee;
    border-radius: var(--radio-md);
    background: #fff;
}

.native-node.is-complete {
    border-color: rgba(10, 122, 53, 0.38);
    background: #effaf3;
}

.native-node h3,
.native-node p {
    margin: 0;
}

.native-choice,
.native-lock label {
    width: 100%;
}

.native-choice.is-wrong {
    border-color: rgba(169, 50, 38, 0.34);
    background: #fff1ee;
}

.native-lab {
    display: grid;
    gap: 0.9rem;
}

.native-field-stage {
    min-height: 18rem;
    position: relative;
    overflow: hidden;
    border: 0.0625rem solid #dfe6ee;
    border-radius: var(--radio-lg);
    background:
        radial-gradient(circle at 25% 50%, rgba(255, 204, 0, 0.22), transparent 8rem),
        linear-gradient(135deg, #082545, #0f80bd);
}

.field-charge,
.field-probe {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    border-radius: 50%;
    transform: translateY(-50%);
}

.field-charge {
    left: 12%;
    width: 4.4rem;
    aspect-ratio: 1;
    background: #ffcc00;
    color: #003366;
    font-size: 2rem;
    font-weight: 900;
    box-shadow: 0 0 2rem rgba(255, 204, 0, 0.66);
}

.field-probe {
    left: 46%;
    width: 2rem;
    aspect-ratio: 1;
    background: #fff;
    color: #003366;
}

.field-probe::before {
    content: "+";
    font-weight: 900;
}

.field-lines {
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    border: 0.1rem solid rgba(255,255,255,0.24);
    box-shadow:
        0 0 0 2.8rem rgba(255,255,255,0.08),
        0 0 0 5.6rem rgba(255,255,255,0.05);
}

.native-slider {
    display: grid;
    gap: 0.45rem;
    color: var(--azul-oscuro);
    font-weight: 800;
}

.native-readout {
    padding: 0.85rem;
    border-radius: var(--radio-md);
    background: #f8fafc;
    color: #526272;
}

.native-readout strong {
    color: var(--azul-oscuro);
}

.game-boss-core {
    width: min(10rem, 46vw);
    aspect-ratio: 1;
    position: relative;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #fff7bf 0 9%, #ffcc00 10% 24%, #0f80bd 25% 58%, #003366 59% 100%);
    box-shadow:
        0 0 1.4rem rgba(255, 204, 0, 0.75),
        0 0 3.2rem rgba(15, 128, 189, 0.52);
    animation: game-core-pulse 2.5s ease-in-out infinite;
}

.game-boss-core.small {
    width: 5.25rem;
}

.game-boss-core::before,
.game-boss-core::after {
    content: "";
    position: absolute;
    inset: -0.65rem;
    border: 0.12rem dashed rgba(255,255,255,0.62);
    border-radius: 50%;
    animation: game-core-spin 8s linear infinite;
}

.game-boss-core::after {
    inset: 1.15rem;
    border-style: solid;
    animation-duration: 4.8s;
    animation-direction: reverse;
}

@keyframes game-core-pulse {
    0%, 100% { transform: scale(1); filter: saturate(1); }
    50% { transform: scale(1.045); filter: saturate(1.2); }
}

@keyframes game-core-spin {
    to { transform: rotate(360deg); }
}

@keyframes game-float {
    0% { transform: translateY(0) scale(0.75); opacity: 0; }
    10% { opacity: 0.8; }
    100% { transform: translateY(-110vh) scale(1.15); opacity: 0; }
}

@keyframes game-ripple {
    to {
        transform: translate(-50%, -50%) scale(38);
        opacity: 0;
    }
}

@keyframes game-burst {
    to {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0;
    }
}

@keyframes game-pop {
    0% { transform: scale(0.98); }
    50% { transform: scale(1.015); }
    100% { transform: scale(1); }
}

@keyframes game-scan {
    0%, 35% { transform: translateX(-100%); }
    70%, 100% { transform: translateX(100%); }
}

@media (max-width: 760px) {
    .game-enhanced.page-activity,
    .game-enhanced.page-boss,
    .game-enhanced.page-boss-u2 {
        background:
            radial-gradient(circle at top, rgba(255, 204, 0, 0.18), transparent 17rem),
            linear-gradient(180deg, #082545 0%, #0a3158 16rem, #eef4fb 16.1rem, #f8fbff 100%) !important;
    }

    .game-enhanced .u2-hero::after,
    .game-enhanced .u3-hero::after,
    .game-enhanced .boss-hero::after,
    .game-enhanced.page-activity h1::after {
        width: 10rem;
        height: 10rem;
        right: -4rem;
        top: -4rem;
    }
}

@media (max-width: 640px) {
    .mission-launch-card,
    .boss-preview-bars {
        grid-template-columns: 1fr;
    }

    .mission-launch-orb,
    .game-boss-core {
        width: 6.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .game-particles,
    .game-burst,
    .game-ripple {
        display: none !important;
    }

    .game-enhanced *,
    .game-enhanced *::before,
    .game-enhanced *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

@media (max-width: 760px) {
    .mis-medallas {
        width: 100%;
    }

    .progreso-general-head {
        display: grid;
    }

    #progreso-porcentaje-grande {
        width: fit-content;
    }
}

/* =========================================================
   Produccion UI baseline: tokens, accesibilidad y responsive
   ========================================================= */
:root {
    --font-sans: Arial, Helvetica, sans-serif;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --container-max: 110rem;
    --touch-target: 2.75rem;
    --focus-ring: 0 0 0 0.2rem rgba(15, 128, 189, 0.28);
    --surface-soft: #f8fafc;
    --danger: #b3261e;
    --success: #0a7a35;
}

html {
    min-width: 20rem;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-width: 20rem;
    font-family: var(--font-sans);
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

:where(main, section, article, aside, header, footer, nav, div, form, fieldset, label) {
    min-width: 0;
}

:where(h1, h2, h3, h4, h5, h6, p, li, td, th, label, span, strong, small, button, a) {
    overflow-wrap: anywhere;
}

:where(button, input, select, textarea) {
    max-width: 100%;
    font: inherit;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
    min-height: var(--touch-target);
    border-radius: var(--radio-sm);
}

:where(button, .btn, .boss-btn, .btn-comprar, .btn-siguiente, .btn-finalizar, .btn-reintentar, .material-btn) {
    min-height: var(--touch-target);
    min-width: var(--touch-target);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

:where(img, svg, video, canvas) {
    max-width: 100%;
    height: auto;
}

:where(iframe) {
    max-width: 100%;
    border: 0;
}

:where(table) {
    width: 100%;
    border-collapse: collapse;
}

:where(.table-responsive, .tabla-responsive, .tabla-wrapper, .usuarios-tabla-wrap, .admin-table-wrap, .ranking-wrap) {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

:where(.card, .card-examen, .actividad-panel-card, .mission-launch-card, .boss-launch-card, .tienda-admin-card, .item-card, .native-node, .mision, .candado) {
    min-width: 0;
    border-radius: max(var(--radio-md), 0.75rem);
}

:where(.contenedor, .admin-layout, .layout, .site-shell, .page-shell) {
    max-width: var(--container-max);
}

:where(.reto-modal-overlay, .premio-modal-overlay, .u1-match-modal-overlay) {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    overflow-y: auto;
    padding: var(--space-4);
}

:where(.reto-modal, .premio-modal, .u1-match-modal) {
    max-width: min(100%, 62rem);
    max-height: calc(100dvh - 2rem);
    overflow: auto;
}

.production-toast {
    position: fixed;
    right: var(--space-4);
    bottom: var(--space-4);
    z-index: 10050;
    width: min(24rem, calc(100vw - 2rem));
    padding: 0.9rem 1rem;
    border: 0.0625rem solid rgba(0, 51, 102, 0.16);
    border-left: 0.28rem solid var(--azul);
    border-radius: var(--radio-md);
    background: rgba(255, 255, 255, 0.98);
    color: var(--texto);
    box-shadow: var(--sombra-suave);
}

.production-toast.is-error {
    border-left-color: var(--danger);
}

.production-toast[hidden] {
    display: none !important;
}

@media (min-width: 120rem) {
    :where(body > header, .top-header, .contenedor, .admin-layout, .layout) {
        max-width: var(--container-max);
    }
}

@media (max-width: 48rem) {
    body > header,
    .top-header,
    .contenedor,
    .admin-layout,
    .layout {
        width: calc(100% - 1rem);
    }

    .contenedor,
    .admin-layout {
        padding: var(--space-4);
    }

    :where(.header-left, .header-links, .logout, .boss-question-nav, .u1-match-actions, .u2-boss-actions, .boss-actions) {
        align-items: stretch;
    }

    :where(.header-links a, .logout a, .btn, .boss-btn, .btn-comprar, .btn-siguiente, .btn-finalizar, .btn-reintentar) {
        white-space: normal;
    }
}

@media (max-width: 30rem) {
    :where(.reto-modal-overlay, .premio-modal-overlay, .u1-match-modal-overlay) {
        padding: var(--space-2);
    }

    :where(.reto-modal, .premio-modal, .u1-match-modal) {
        max-height: calc(100dvh - 1rem);
        border-radius: var(--radio-lg);
    }
}

/* =========================================================
   Tema institucional unificado
   Mantiene todas las paginas en la misma linea visual de index.php:
   blanco, azul UABC/EyM, acentos dorados, tarjetas limpias.
   ========================================================= */
:root {
    --template-bg:
        radial-gradient(circle at 10% 0%, rgba(255, 204, 0, 0.13), transparent 22rem),
        radial-gradient(circle at 92% 4%, rgba(15, 128, 189, 0.13), transparent 25rem),
        linear-gradient(135deg, #eceff3 0%, #f8fbfd 48%, #e7f0f8 100%);
    --template-panel: rgba(255, 255, 255, 0.96);
    --template-panel-soft: #f8fafc;
    --template-border: #d5dbe3;
    --template-blue-shadow: 0 1rem 2.6rem rgba(0, 30, 70, 0.11);
    --template-card-shadow: 0 0.8rem 1.85rem rgba(0, 30, 70, 0.08);
}

body.page-panel,
body.page-admin,
body.page-store,
body.page-activity,
body.page-boss,
body.page-boss-u2,
body.page-first-login {
    background: var(--template-bg) !important;
    color: var(--texto) !important;
}

body.page-panel > .top-header,
body.page-admin .admin-header,
body.page-boss > header,
body.page-boss-u2 > header,
body.page-activity > header,
.reward-header {
    width: calc(100% - clamp(1rem, 3vw, 4.5rem)) !important;
    margin: clamp(0.5rem, 1.5vw, 1.5rem) auto 0 !important;
    padding: clamp(1rem, 2vw, 1.6rem) clamp(1rem, 3vw, 2.75rem) !important;
    border: 0.0625rem solid var(--template-border) !important;
    border-top: 0.32rem solid var(--azul-oscuro) !important;
    border-radius: var(--radio-lg) var(--radio-lg) 0 0 !important;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 253, 0.95)),
        radial-gradient(circle at top right, rgba(0, 85, 153, 0.1), transparent 18rem) !important;
    color: var(--texto) !important;
    box-shadow: var(--template-blue-shadow) !important;
}

body.page-panel > .top-header h1,
body.page-admin .admin-title-row h1,
body.page-boss > header h1,
body.page-boss-u2 > header h1,
body.page-activity > header h1,
.reward-header h1 {
    color: var(--azul-oscuro) !important;
}

body.page-panel > .top-header p,
body.page-admin .admin-header p,
body.page-boss > header p,
body.page-boss-u2 > header p,
body.page-activity > header p,
.reward-header p {
    color: #617182 !important;
}

.header-links a,
.logout a,
.reward-back,
.reward-primary,
.page-admin .admin-header-actions a,
.page-admin .btn,
.btn,
.btn-comprar,
.btn-siguiente,
.btn-finalizar,
.btn-reintentar {
    border: 0 !important;
    border-radius: 999rem !important;
    background: var(--azul) !important;
    color: #ffffff !important;
    box-shadow: 0 0.7rem 1.45rem rgba(0, 85, 153, 0.16) !important;
    text-decoration: none !important;
}

.header-links a:hover,
.logout a:hover,
.reward-back:hover,
.reward-primary:hover,
.page-admin .admin-header-actions a:hover,
.page-admin .btn:hover,
.btn:hover,
.btn-comprar:hover,
.btn-siguiente:hover,
.btn-finalizar:hover,
.btn-reintentar:hover {
    background: var(--azul-oscuro) !important;
    color: #ffffff !important;
    box-shadow: 0 0.9rem 1.8rem rgba(0, 51, 102, 0.2) !important;
}

.btn-dorado,
nav .nav-cta,
.admin-scope-selector button,
.btn-salto-pregunta {
    background: var(--dorado) !important;
    color: var(--azul-oscuro) !important;
    box-shadow: 0 0.7rem 1.35rem rgba(255, 204, 0, 0.2) !important;
}

.btn-dorado:hover,
nav .nav-cta:hover,
.admin-scope-selector button:hover,
.btn-salto-pregunta:hover {
    background: var(--dorado-oscuro) !important;
    color: var(--azul-oscuro) !important;
}

body.page-panel .layout,
body.page-admin .admin-layout,
body.page-activity .contenedor,
body.page-activity .panel-escape,
body.page-boss .contenedor,
body.page-boss-u2 .boss-shell,
body.page-first-login .contenedor,
body.page-first-login .reset-container {
    border: 0.0625rem solid var(--template-border) !important;
    background: var(--template-panel) !important;
    box-shadow: var(--template-blue-shadow) !important;
}

body.page-panel .layout,
body.page-admin .admin-layout {
    border-top: 0 !important;
    border-radius: 0 0 var(--radio-lg) var(--radio-lg) !important;
}

body.page-panel .layout {
    width: calc(100% - clamp(1rem, 3vw, 4.5rem)) !important;
    margin: 0 auto clamp(1.5rem, 3vw, 3rem) !important;
    padding: clamp(1rem, 2vw, 1.6rem) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    gap: clamp(0.85rem, 1.6vw, 1.35rem) !important;
}

body.page-panel .sidebar {
    border: 0.0625rem solid rgba(0, 51, 102, 0.16) !important;
    border-radius: var(--radio-lg) !important;
    background:
        linear-gradient(180deg, var(--azul), var(--azul-oscuro)),
        radial-gradient(circle at 50% 0%, rgba(255, 204, 0, 0.2), transparent 14rem) !important;
    box-shadow: 0 0.8rem 1.8rem rgba(0, 51, 102, 0.16) !important;
}

body.page-panel .sidebar h3 {
    color: #ffffff !important;
}

body.page-panel .unidad-btn {
    border: 0.0625rem solid rgba(255, 255, 255, 0.14) !important;
    background: rgba(0, 51, 102, 0.82) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

body.page-panel .unidad-btn:hover {
    background: rgba(0, 45, 82, 0.98) !important;
}

body.page-panel .submenu a {
    color: #f7fbff !important;
}

body.page-panel .submenu a:hover {
    background: rgba(255, 204, 0, 0.18) !important;
    color: #ffffff !important;
}

body.page-panel .content,
body.page-panel .right-panel {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.content-box,
.leaderboard,
.widget-extra,
.curso-progreso,
.mis-medallas,
.actividad-panel-card,
.card,
.admin-module-card,
.admin-section-card,
.tienda-admin-card,
.unidad-config-card,
.banner-slide-card,
.reto-pregunta-card,
.personaje-card,
.practica-admin-card,
.medalla-admin-card,
.boss-status,
.pregunta,
.reward-panel,
.reward-stat,
.reward-result {
    border: 0.0625rem solid var(--template-border) !important;
    border-radius: var(--radio-lg) !important;
    background:
        linear-gradient(180deg, #ffffff, var(--template-panel-soft)),
        #ffffff !important;
    color: var(--texto) !important;
    box-shadow: var(--template-card-shadow) !important;
}

.content-box h2,
.leaderboard h2,
.widget-extra h2,
.curso-progreso h2,
.mis-medallas h2,
.actividad-panel-card h2,
.card h2,
.admin-module-card strong,
.admin-section-card h2,
.tienda-admin-card h3,
.medalla-admin-card h3,
.boss-status strong,
.pregunta strong,
.reward-panel h2,
.reward-result h3 {
    color: var(--azul-oscuro) !important;
}

body.page-admin .admin-eyebrow,
.progreso-kicker,
.actividad-kicker,
.reward-kicker,
.boss-generic-kicker,
.admin-module-card span,
.unidad1-admin-badge,
.beneficio-meta span {
    border: 0.0625rem solid rgba(0, 85, 153, 0.16) !important;
    background: #eef6fc !important;
    color: var(--azul-oscuro) !important;
}

body.page-admin .verified-badge {
    border-color: rgba(10, 143, 74, 0.28) !important;
    background: rgba(10, 143, 74, 0.1) !important;
    color: #08743e !important;
}

input,
select,
textarea,
.page-admin input,
.page-admin select,
.page-admin textarea {
    border: 0.0625rem solid #cfd8e3 !important;
    background: #ffffff !important;
    color: var(--texto) !important;
}

input:focus,
select:focus,
textarea:focus,
.page-admin input:focus,
.page-admin select:focus,
.page-admin textarea:focus {
    border-color: var(--azul) !important;
    box-shadow: 0 0 0 0.18rem rgba(0, 85, 153, 0.14) !important;
}

table th,
.page-admin th,
.leaderboard th,
.tabla-bonos th {
    background: #edf4fb !important;
    color: var(--azul-oscuro) !important;
}

table td,
table th {
    border-color: #dfe6ee !important;
}

tr:nth-child(even) {
    background: rgba(0, 85, 153, 0.035);
}

.mensaje,
.mensaje-servidor {
    border: 0.0625rem solid #ffe08a !important;
    border-left: 0.32rem solid var(--dorado) !important;
    background: #fff8dc !important;
    color: #644b00 !important;
}

.game-enhanced.page-panel,
.game-enhanced.page-activity,
.game-enhanced.page-boss,
.game-enhanced.page-boss-u2 {
    background: var(--template-bg) !important;
    background-attachment: scroll !important;
}

.game-enhanced .u2-hero,
.game-enhanced .u3-hero,
.game-enhanced .boss-hero,
.game-enhanced.page-activity h1,
.game-enhanced body > header {
    border: 0.0625rem solid var(--template-border) !important;
    border-top: 0.32rem solid var(--azul-oscuro) !important;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 253, 0.95)),
        radial-gradient(circle at top right, rgba(255, 204, 0, 0.16), transparent 18rem) !important;
    color: var(--texto) !important;
}

.game-enhanced .u2-hero h1,
.game-enhanced .u2-hero p,
.game-enhanced .u3-hero h1,
.game-enhanced .u3-hero p,
.game-enhanced .boss-hero h1,
.game-enhanced .boss-hero p,
.game-enhanced.page-activity h1,
.game-enhanced body > header h1,
.game-enhanced body > header p {
    color: var(--azul-oscuro) !important;
}

.game-enhanced .u2-hero p,
.game-enhanced .u3-hero p,
.game-enhanced .boss-hero p,
.game-enhanced body > header p {
    color: #617182 !important;
}

.game-enhanced .contenedor,
.game-enhanced .panel-escape,
.game-enhanced .u2-game-card,
.game-enhanced .u3-game,
.game-enhanced .boss-arena,
.game-enhanced .boss-card,
.game-enhanced .card-examen,
.game-enhanced .actividad-panel-card {
    border: 0.0625rem solid var(--template-border) !important;
    background: linear-gradient(145deg, #ffffff, #f8fafc) !important;
    box-shadow: var(--template-card-shadow) !important;
}

@media (max-width: 64rem) {
    body.page-panel .layout {
        grid-template-columns: 1fr !important;
    }

    body.page-panel .sidebar,
    body.page-panel .content,
    body.page-panel .right-panel {
        width: 100% !important;
    }
}

@media (max-width: 48rem) {
    body.page-panel > .top-header,
    body.page-admin .admin-header,
    body.page-boss > header,
    body.page-boss-u2 > header,
    body.page-activity > header,
    body.page-panel .layout,
    body.page-admin .admin-layout,
    .reward-header {
        width: calc(100% - 1rem) !important;
    }
}

/* Admin: ajuste de alineacion fina del encabezado y el cuerpo */
body.page-admin {
    --admin-shell-width: min(112rem, calc(100% - clamp(1rem, 3vw, 4.5rem)));
}

body.page-admin .admin-header,
body.page-admin .admin-layout {
    width: var(--admin-shell-width) !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.page-admin .admin-header {
    margin-bottom: 0 !important;
    border-bottom-color: rgba(213, 219, 227, 0.72) !important;
}

body.page-admin .admin-layout {
    margin-top: 0 !important;
    border-top: 0 !important;
    border-radius: 0 0 var(--radio-lg) var(--radio-lg) !important;
}

body.page-admin .admin-header-content {
    grid-template-columns: minmax(20rem, 1fr) minmax(28rem, 52rem) !important;
    gap: clamp(1rem, 2vw, 2rem) !important;
}

body.page-admin .admin-header-actions {
    display: grid !important;
    grid-template-columns: minmax(18rem, 1fr) auto auto;
    align-items: end !important;
    justify-content: stretch !important;
    gap: 0.7rem !important;
    width: 100%;
}

body.page-admin .admin-header-actions .admin-scope-selector {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.45rem 0.65rem;
    width: 100%;
    margin: 0 !important;
}

body.page-admin .admin-header-actions .admin-scope-selector label {
    grid-column: 1 / -1;
    color: var(--azul-oscuro) !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    line-height: 1.2;
}

body.page-admin .admin-header-actions .admin-scope-selector select {
    width: 100% !important;
    max-width: none !important;
    min-height: 2.65rem !important;
}

body.page-admin .admin-header-actions .admin-scope-selector button {
    min-height: 2.55rem !important;
    margin: 0 !important;
    white-space: nowrap;
}

body.page-admin .admin-header-actions > a {
    min-height: 2.65rem !important;
    margin: 0 !important;
    white-space: nowrap;
}

body.page-admin .admin-module-grid {
    width: 100%;
    margin-top: 0 !important;
}

@media (max-width: 78rem) {
    body.page-admin .admin-header-content,
    body.page-admin .admin-header-actions {
        grid-template-columns: 1fr !important;
    }

    body.page-admin .admin-header-actions > a,
    body.page-admin .admin-header-actions .admin-scope-selector button {
        width: 100%;
    }
}

@media (max-width: 48rem) {
    body.page-admin {
        --admin-shell-width: calc(100% - 1rem);
    }

    body.page-admin .admin-header-actions .admin-scope-selector {
        grid-template-columns: 1fr;
    }
}

/* Personajes nuevos: tarjetas premium para seleccion de avatar */
.personajes-opciones,
.personajes-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)) !important;
    gap: clamp(0.8rem, 1.6vw, 1.1rem) !important;
    align-items: stretch;
}

.personaje-card {
    position: relative;
    display: grid !important;
    gap: 0.7rem;
    place-items: center;
    min-height: 12rem;
    padding: 0.9rem !important;
    overflow: hidden;
    border: 0.0625rem solid #d5e2ef !important;
    border-top: 0.26rem solid var(--azul) !important;
    border-radius: 1.35rem !important;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 204, 0, 0.14), transparent 7rem),
        linear-gradient(180deg, #ffffff, #f3f8fc) !important;
    color: var(--azul-oscuro) !important;
    box-shadow: 0 0.9rem 1.9rem rgba(0, 30, 70, 0.1) !important;
    text-align: center;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.personaje-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 88% 8%, rgba(15, 128, 189, 0.12), transparent 6rem),
        linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.55));
    pointer-events: none;
}

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

.personaje-card:hover,
.personaje-card:focus-within {
    transform: translateY(-0.18rem);
    border-color: rgba(0, 85, 153, 0.45) !important;
    box-shadow: 0 1.15rem 2.35rem rgba(0, 51, 102, 0.15), 0 0 0 0.22rem rgba(255, 204, 0, 0.12) !important;
}

.personaje-card:has(input:checked) {
    border-color: var(--azul) !important;
    border-top-color: var(--dorado) !important;
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 204, 0, 0.22), transparent 7rem),
        linear-gradient(180deg, #ffffff, #eef6fc) !important;
    box-shadow: 0 1.2rem 2.55rem rgba(0, 51, 102, 0.18), 0 0 0 0.22rem rgba(0, 85, 153, 0.14) !important;
}

.personaje-card input[type="radio"] {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    width: 1.2rem !important;
    min-width: 1.2rem !important;
    height: 1.2rem !important;
    min-height: 1.2rem !important;
    accent-color: var(--azul);
}

.personaje-card img {
    width: clamp(6.8rem, 9vw, 8.4rem) !important;
    height: clamp(6.8rem, 9vw, 8.4rem) !important;
    display: block;
    object-fit: contain !important;
    padding: 0.28rem;
    border: 0.0625rem solid rgba(0, 85, 153, 0.16) !important;
    border-radius: 1.15rem !important;
    background:
        radial-gradient(circle at 50% 40%, rgba(15, 128, 189, 0.1), transparent 70%),
        #ffffff !important;
    box-shadow: 0 0.9rem 1.6rem rgba(0, 51, 102, 0.14) !important;
}

.personaje-card div {
    color: var(--azul-oscuro);
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.2;
}

.user-avatar-img {
    object-fit: contain !important;
    background:
        radial-gradient(circle at 50% 30%, rgba(255, 204, 0, 0.12), transparent 70%),
        #ffffff !important;
}

body.page-panel .user-avatar-box {
    min-width: clamp(13rem, 16vw, 16rem) !important;
    padding: 0.75rem;
    border: 0.0625rem solid rgba(0, 85, 153, 0.16);
    border-radius: 1.6rem;
    background:
        radial-gradient(circle at 50% 16%, rgba(255, 204, 0, 0.16), transparent 8rem),
        linear-gradient(180deg, #ffffff, #f4f9fd);
    box-shadow: 0 1rem 2.1rem rgba(0, 30, 70, 0.1);
}

body.page-panel .user-avatar-img {
    width: clamp(12rem, 15vw, 15.5rem) !important;
    height: clamp(12rem, 15vw, 15.5rem) !important;
    max-width: 100%;
    margin: 0 auto 0.35rem !important;
    padding: 0.35rem;
    border: 0.0625rem solid rgba(0, 85, 153, 0.18) !important;
    border-radius: 1.35rem !important;
    object-fit: contain !important;
    box-shadow: 0 1rem 1.85rem rgba(0, 51, 102, 0.16) !important;
}

body.page-panel .user-avatar-box > strong {
    display: block;
    color: var(--azul-oscuro);
    font-size: 0.98rem;
    line-height: 1.2;
}

body.page-panel .header-left {
    display: grid !important;
    grid-template-columns: auto minmax(22rem, 1fr) minmax(18rem, 24rem);
    align-items: stretch !important;
    gap: clamp(1rem, 1.8vw, 1.5rem) !important;
}

body.page-panel .mis-medallas {
    width: 100% !important;
    height: fit-content !important;
    min-height: 0 !important;
    min-width: 0 !important;
    max-width: 24rem;
    justify-self: end;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: clamp(1rem, 1.4vw, 1.25rem) !important;
    border-radius: 1.6rem !important;
    background:
        radial-gradient(circle at 50% 6%, rgba(255, 204, 0, 0.12), transparent 10rem),
        linear-gradient(180deg, #ffffff, #f4f9fd) !important;
}

body.page-panel .mis-medallas-head {
    width: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    margin-bottom: 0.8rem !important;
}

body.page-panel .mis-medallas h2 {
    font-size: clamp(1.05rem, 1.2vw, 1.25rem) !important;
}

body.page-panel .medallas-empty {
    align-self: center;
    justify-self: center;
    max-width: 16rem;
    margin: 0 0 0.85rem !important;
    text-align: center;
}

body.page-panel .medallas-lista {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 19.5rem);
    min-height: 0;
    align-self: center !important;
    justify-self: center !important;
    place-content: center !important;
    justify-items: center;
    align-items: center;
    gap: clamp(0.8rem, 1.2vw, 1rem);
    overflow: visible !important;
    padding: 0 !important;
}

body.page-panel .medalla-chip {
    width: clamp(7.2rem, 8.2vw, 8.5rem) !important;
    height: clamp(7.2rem, 8.2vw, 8.5rem) !important;
    max-width: none !important;
    flex: none !important;
    padding: 0.45rem !important;
    border-radius: 1.6rem !important;
}

body.page-panel .medalla-icono,
body.page-panel .medalla-icono.has-image {
    width: 100% !important;
    height: 100% !important;
}

body.page-panel .medalla-icono.has-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 86rem) {
    body.page-panel .header-left {
        grid-template-columns: auto minmax(0, 1fr);
    }

    body.page-panel .mis-medallas {
        grid-column: 1 / -1;
        justify-self: stretch;
        max-width: none;
    }

    body.page-panel .medallas-lista {
        grid-template-columns: repeat(2, minmax(7rem, 9rem));
        justify-content: center;
    }
}

@media (max-width: 40rem) {
    .personajes-opciones,
    .personajes-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .personaje-card {
        min-height: 10.8rem;
        padding: 0.75rem !important;
    }

    body.page-panel .user-avatar-box {
        min-width: 100% !important;
    }

    body.page-panel .user-avatar-img {
        width: min(14rem, 78vw) !important;
        height: min(14rem, 78vw) !important;
    }

    body.page-panel .header-left {
        grid-template-columns: 1fr;
    }

    body.page-panel .medallas-lista {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.page-panel .medalla-chip {
        width: min(8rem, 38vw) !important;
        height: min(8rem, 38vw) !important;
    }
}

/* Panel: avance general superior */
body.page-panel > .curso-progreso {
    width: calc(100% - clamp(1rem, 3vw, 4.5rem)) !important;
    max-width: var(--container-max);
    margin: clamp(0.75rem, 1.5vw, 1.1rem) auto !important;
    padding: clamp(0.85rem, 1.45vw, 1.2rem) !important;
    gap: clamp(0.75rem, 1.1vw, 1rem) !important;
    border: 0.0625rem solid #d5dbe3 !important;
    border-top: 0.26rem solid var(--azul-oscuro) !important;
    border-radius: 1.35rem !important;
    background:
        radial-gradient(circle at 96% 8%, rgba(0, 85, 153, 0.1), transparent 16rem),
        linear-gradient(180deg, #ffffff, #f8fbfd) !important;
    box-shadow: 0 1rem 2.4rem rgba(0, 30, 70, 0.1) !important;
}

body.page-panel > .curso-progreso .progreso-general-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
}

body.page-panel > .curso-progreso .progreso-kicker {
    margin: 0 0 0.2rem;
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--azul-oscuro) !important;
    font-size: clamp(0.72rem, 0.85vw, 0.82rem);
    font-weight: 900;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: inset 0 -0.35rem 0 rgba(15, 128, 189, 0.16);
}

body.page-panel > .curso-progreso h2 {
    margin: 0 !important;
    color: var(--azul-oscuro) !important;
    font-size: clamp(1.35rem, 2.1vw, 2.05rem) !important;
    line-height: 1.02;
    letter-spacing: 0.02em;
}

body.page-panel > .curso-progreso p {
    margin: 0.25rem 0 0 !important;
    color: #607284 !important;
    font-size: clamp(0.86rem, 1vw, 1rem) !important;
    font-weight: 700;
}

body.page-panel > .curso-progreso #progreso-porcentaje-grande {
    min-width: clamp(4.8rem, 6.2vw, 6.4rem);
    padding: 0.34rem 0.8rem !important;
    border-radius: 999rem !important;
    background: var(--azul-oscuro) !important;
    color: #ffffff !important;
    font-size: clamp(1.35rem, 2vw, 2rem) !important;
    line-height: 1;
    text-align: center;
    box-shadow: 0 0.65rem 1.35rem rgba(0, 51, 102, 0.22);
}

body.page-panel > .curso-progreso > .progreso-barra {
    min-height: 0.52rem !important;
    border-radius: 999rem !important;
    background: #dce6f0 !important;
}

body.page-panel > .curso-progreso > .progreso-barra span {
    background: linear-gradient(90deg, var(--azul), var(--azul-claro) 74%, var(--dorado)) !important;
}

body.page-panel > .curso-progreso .progreso-resumen-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: clamp(0.6rem, 1vw, 0.9rem) !important;
}

body.page-panel > .curso-progreso .progreso-resumen-grid > div,
body.page-panel > .curso-progreso .progreso-unidad-card {
    border: 0.0625rem solid #dce5ee !important;
    border-radius: 1rem !important;
    background: #ffffff !important;
    box-shadow: 0 0.55rem 1.15rem rgba(0, 30, 70, 0.055) !important;
}

body.page-panel > .curso-progreso .progreso-resumen-grid > div {
    padding: 0.7rem 0.9rem !important;
}

body.page-panel > .curso-progreso .progreso-resumen-grid span,
body.page-panel > .curso-progreso .progreso-unidad-card span {
    color: #607284 !important;
    font-size: 0.8rem !important;
    font-weight: 800;
    line-height: 1.2;
}

body.page-panel > .curso-progreso .progreso-resumen-grid strong {
    color: var(--azul-oscuro) !important;
    font-size: clamp(1.05rem, 1.35vw, 1.35rem) !important;
    line-height: 1;
}

body.page-panel > .curso-progreso .progreso-unidades-lista {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: clamp(0.65rem, 1vw, 0.9rem) !important;
}

body.page-panel > .curso-progreso .progreso-unidad-card {
    gap: 0.45rem !important;
    padding: 0.7rem 0.85rem !important;
}

body.page-panel > .curso-progreso .progreso-unidad-card strong {
    color: var(--azul-oscuro) !important;
    font-size: clamp(0.86rem, 1vw, 1rem) !important;
    line-height: 1.05;
}

body.page-panel > .curso-progreso .progreso-barra.unidad {
    min-height: 0.42rem !important;
}

body.page-panel > .layout {
    margin-top: 0 !important;
}

@media (max-width: 68rem) {
    body.page-panel > .curso-progreso .progreso-unidades-lista {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 42rem) {
    body.page-panel > .curso-progreso {
        width: calc(100% - 1rem) !important;
    }

    body.page-panel > .curso-progreso .progreso-general-head,
    body.page-panel > .curso-progreso .progreso-resumen-grid,
    body.page-panel > .curso-progreso .progreso-unidades-lista {
        grid-template-columns: 1fr !important;
    }

    body.page-panel > .curso-progreso #progreso-porcentaje-grande {
        justify-self: start;
    }
}

/* Panel: avance general incrustado en el encabezado */
body.page-panel .info-usuario .curso-progreso {
    width: 100% !important;
    max-width: none !important;
    margin: clamp(0.85rem, 1.2vw, 1rem) 0 0 !important;
    padding: clamp(0.75rem, 1.15vw, 1rem) !important;
    gap: clamp(0.55rem, 0.9vw, 0.75rem) !important;
    border: 0.0625rem solid #d5dbe3 !important;
    border-top: 0.24rem solid var(--azul-oscuro) !important;
    border-radius: 1.15rem !important;
    background:
        radial-gradient(circle at 96% 0%, rgba(0, 85, 153, 0.08), transparent 13rem),
        linear-gradient(180deg, #ffffff, #f8fbfd) !important;
    box-shadow: 0 0.75rem 1.65rem rgba(0, 30, 70, 0.075) !important;
}

body.page-panel .info-usuario .curso-progreso .progreso-general-head {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: start;
}

body.page-panel .info-usuario .curso-progreso .progreso-kicker {
    margin: 0 0 0.18rem !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--azul-oscuro) !important;
    font-size: 0.72rem !important;
    font-weight: 900;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: inset 0 -0.28rem 0 rgba(15, 128, 189, 0.16);
}

body.page-panel .info-usuario .curso-progreso h2 {
    margin: 0 !important;
    color: var(--azul-oscuro) !important;
    font-size: clamp(1rem, 1.35vw, 1.45rem) !important;
    line-height: 1.08;
    letter-spacing: 0.01em;
}

body.page-panel .info-usuario .curso-progreso p {
    margin: 0.18rem 0 0 !important;
    color: #607284 !important;
    font-size: clamp(0.78rem, 0.9vw, 0.9rem) !important;
    font-weight: 700;
    line-height: 1.25;
}

body.page-panel .info-usuario .curso-progreso #progreso-porcentaje-grande {
    min-width: 4.4rem !important;
    padding: 0.28rem 0.7rem !important;
    border-radius: 999rem !important;
    background: var(--azul-oscuro) !important;
    color: #ffffff !important;
    font-size: clamp(1.05rem, 1.45vw, 1.55rem) !important;
    line-height: 1;
    text-align: center;
    box-shadow: 0 0.55rem 1.1rem rgba(0, 51, 102, 0.2);
}

body.page-panel .info-usuario .curso-progreso > .progreso-barra {
    min-height: 0.42rem !important;
    background: #dce6f0 !important;
}

body.page-panel .info-usuario .curso-progreso > .progreso-barra span {
    background: linear-gradient(90deg, var(--azul), var(--azul-claro) 74%, var(--dorado)) !important;
}

body.page-panel .info-usuario .curso-progreso .progreso-resumen-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.55rem !important;
}

body.page-panel .info-usuario .curso-progreso .progreso-resumen-grid > div,
body.page-panel .info-usuario .curso-progreso .progreso-unidad-card {
    padding: 0.55rem 0.7rem !important;
    border: 0.0625rem solid #dce5ee !important;
    border-radius: 0.9rem !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

body.page-panel .info-usuario .curso-progreso .progreso-resumen-grid span,
body.page-panel .info-usuario .curso-progreso .progreso-unidad-card span {
    color: #607284 !important;
    font-size: 0.72rem !important;
    font-weight: 800;
    line-height: 1.12;
}

body.page-panel .info-usuario .curso-progreso .progreso-resumen-grid strong {
    color: var(--azul-oscuro) !important;
    font-size: 1.02rem !important;
    line-height: 1;
}

body.page-panel .info-usuario .curso-progreso .progreso-unidades-lista {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.55rem !important;
}

body.page-panel .info-usuario .curso-progreso .progreso-unidad-card {
    gap: 0.35rem !important;
}

body.page-panel .info-usuario .curso-progreso .progreso-unidad-card strong {
    color: var(--azul-oscuro) !important;
    font-size: clamp(0.76rem, 0.85vw, 0.86rem) !important;
    line-height: 1.05;
}

body.page-panel .info-usuario .curso-progreso .progreso-barra.unidad {
    min-height: 0.34rem !important;
}

@media (max-width: 86rem) {
    body.page-panel .info-usuario .curso-progreso .progreso-unidades-lista {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 40rem) {
    body.page-panel .info-usuario .curso-progreso .progreso-general-head,
    body.page-panel .info-usuario .curso-progreso .progreso-resumen-grid,
    body.page-panel .info-usuario .curso-progreso .progreso-unidades-lista {
        grid-template-columns: 1fr !important;
    }

    body.page-panel .info-usuario .curso-progreso #progreso-porcentaje-grande {
        justify-self: start;
    }
}

/* Panel: nivel y recompensa debajo del avatar */
body.page-panel .user-avatar-box .game-reward-widget {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0.85rem auto 0 !important;
    padding: 0.72rem !important;
    display: grid !important;
    grid-template-columns: clamp(3.2rem, 4.2vw, 3.85rem) minmax(0, 1fr) !important;
    gap: 0.68rem !important;
    align-items: center !important;
    text-align: left !important;
    border: 0.0625rem solid rgba(0, 85, 153, 0.18) !important;
    border-radius: 1.28rem !important;
    background:
        radial-gradient(circle at 0% 0%, rgba(255, 204, 0, 0.16), transparent 5.5rem),
        linear-gradient(135deg, #ffffff, #f3f9fd) !important;
    box-shadow:
        inset 0 0.0625rem 0 rgba(255, 255, 255, 0.95),
        0 0.9rem 1.6rem rgba(0, 30, 70, 0.08) !important;
}

body.page-panel .user-avatar-box .game-chest,
body.page-panel .user-avatar-box .game-level-icon {
    width: 100% !important;
    min-width: 0 !important;
    border-radius: 0.9rem !important;
    align-self: center !important;
}

body.page-panel .user-avatar-box .game-reward-content {
    min-width: 0 !important;
    gap: 0 !important;
    align-items: stretch !important;
}

body.page-panel .user-avatar-box .game-reward-content > strong {
    display: block !important;
    margin: 0 0 0.1rem !important;
    color: var(--azul-oscuro) !important;
    font-size: clamp(0.78rem, 0.82vw, 0.88rem) !important;
    font-weight: 900 !important;
    line-height: 1.12 !important;
}

body.page-panel .user-avatar-box .game-reward-widget p {
    margin: 0 0 0.32rem !important;
    color: #607284 !important;
    font-size: clamp(0.68rem, 0.72vw, 0.76rem) !important;
    font-weight: 700 !important;
    line-height: 1.18 !important;
}

body.page-panel .user-avatar-box .game-reward-content .progreso-barra {
    width: 100% !important;
    min-height: 0.42rem !important;
    margin: 0.1rem 0 0.22rem !important;
    background: #dfe8f1 !important;
    box-shadow: none !important;
}

body.page-panel .user-avatar-box .game-reward-content .progreso-barra span {
    background: linear-gradient(90deg, var(--azul), var(--azul-claro) 78%, var(--dorado)) !important;
}

body.page-panel .user-avatar-box .game-reward-widget small {
    display: block !important;
    color: #607284 !important;
    font-size: clamp(0.64rem, 0.68vw, 0.72rem) !important;
    font-weight: 700 !important;
    line-height: 1.12 !important;
}

body.page-panel .user-avatar-box .game-reward-widget small strong {
    display: inline !important;
    color: var(--azul-oscuro) !important;
    font-size: inherit !important;
    font-weight: 900 !important;
    line-height: inherit !important;
}

body.page-panel .user-avatar-box .premio-reclamo-slot {
    width: 100%;
    margin-top: 0.45rem;
}

body.page-panel .user-avatar-box .btn-reclamar-premio {
    width: 100%;
    min-width: 0;
    justify-content: center;
    margin-top: 0.42rem;
    padding: 0.58rem 0.75rem;
    font-size: 0.78rem;
    border-radius: 999rem;
}

@media (max-width: 58rem) {
    body.page-panel .user-avatar-box .game-reward-widget {
        grid-template-columns: clamp(3.2rem, 18vw, 4rem) minmax(0, 1fr) !important;
    }
}

/* Administrador: editor de nombres de niveles XP */
.xp-levels-form {
    margin-bottom: 1rem;
}

.xp-levels-form .tienda-toolbar > div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.xp-levels-form .tienda-toolbar small {
    color: #607284;
    font-weight: 700;
}

.xp-levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
    gap: clamp(0.75rem, 1vw, 1rem);
    width: 100%;
}

.xp-level-card,
.xp-level-new-card {
    border: 0.0625rem solid var(--template-border);
    border-radius: var(--radio-lg);
    background:
        radial-gradient(circle at 100% 0%, rgba(0, 85, 153, 0.08), transparent 9rem),
        linear-gradient(180deg, #ffffff, var(--template-panel-soft));
    box-shadow: 0 0.75rem 1.45rem rgba(0, 30, 70, 0.075);
}

.xp-level-card {
    display: grid;
    gap: 0.65rem;
    padding: 0.85rem;
}

.xp-level-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.xp-level-card-head span,
.xp-level-new-card legend {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 1.7rem;
    padding: 0.25rem 0.65rem;
    border: 0.0625rem solid rgba(0, 85, 153, 0.16);
    border-radius: 999rem;
    background: #eef6fc;
    color: var(--azul-oscuro);
    font-size: 0.78rem;
    font-weight: 900;
}

.xp-level-card-head small {
    color: #607284;
    font-size: 0.78rem;
    font-weight: 800;
}

.xp-level-card .form-group,
.xp-level-new-card .form-group {
    margin: 0;
}

.xp-level-new-card {
    display: grid;
    grid-template-columns: minmax(7rem, 0.55fr) minmax(12rem, 1fr) minmax(12rem, 1.2fr);
    gap: clamp(0.75rem, 1vw, 1rem);
    align-items: end;
    margin-top: 1rem;
    padding: 1rem;
}

.xp-level-new-card legend {
    grid-column: 1 / -1;
    margin-bottom: 0.15rem;
}

@media (max-width: 52rem) {
    .xp-level-new-card {
        grid-template-columns: 1fr;
    }
}

/* Administrador: configuracion compacta de niveles y premios */
body.page-admin .xp-admin-selector-card {
    margin: 0 0 1rem;
    padding: 0.9rem;
    border: 0.0625rem solid var(--template-border);
    border-radius: var(--radio-lg);
    background:
        linear-gradient(135deg, #ffffff, #f4f9fd);
    box-shadow: 0 0.75rem 1.45rem rgba(0, 30, 70, 0.07);
}

body.page-admin .xp-admin-selector-card-compact {
    margin-top: 0.35rem;
}

body.page-admin .xp-admin-selector-form {
    display: grid;
    grid-template-columns: minmax(15rem, 1fr) auto;
    gap: 0.85rem;
    align-items: end;
}

body.page-admin .xp-admin-selector-card .form-group {
    margin: 0;
}

body.page-admin .xp-level-single-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem !important;
    width: 100% !important;
    margin: 0 0 1.25rem !important;
}

body.page-admin .xp-level-editor-card {
    display: grid !important;
    grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr) !important;
    gap: clamp(1rem, 2vw, 1.6rem) !important;
    align-items: start !important;
    padding: clamp(1rem, 1.5vw, 1.25rem) !important;
    width: min(100%, 58rem) !important;
    margin: 0 auto !important;
}

body.page-admin .xp-level-icon-preview {
    width: min(100%, 8.5rem);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    justify-self: center;
    border: 0.0625rem solid rgba(0, 85, 153, 0.2);
    border-radius: 1.35rem;
    background:
        radial-gradient(circle at 50% 42%, rgba(0, 168, 232, 0.2), transparent 55%),
        linear-gradient(145deg, #ffffff, #eaf4fb);
    box-shadow:
        inset 0 0.0625rem 0 rgba(255,255,255,0.95),
        0 1rem 2rem rgba(0, 30, 70, 0.12);
    overflow: hidden;
}

body.page-admin .xp-level-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.page-admin .xp-level-icon-preview span {
    color: var(--azul-oscuro);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 950;
    letter-spacing: 0;
}

body.page-admin .xp-level-editor-fields {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(13rem, 1fr)) !important;
    gap: 0.85rem !important;
    min-width: 0 !important;
}

body.page-admin .xp-level-editor-fields .xp-level-card-head {
    grid-column: 1 / -1 !important;
}

body.page-admin .xp-level-editor-fields .form-group {
    min-width: 0 !important;
}

body.page-admin .xp-level-editor-fields .form-group:nth-of-type(3),
body.page-admin .xp-level-editor-fields .form-group:nth-of-type(5) {
    grid-column: 1 / -1 !important;
}

body.page-admin .xp-level-editor-fields label,
body.page-admin .xp-level-new-card label,
body.page-admin .premios-nivel-form label {
    display: block !important;
    margin-bottom: 0.35rem !important;
    color: var(--azul-oscuro) !important;
    font-size: 0.86rem !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

body.page-admin .xp-level-editor-fields input,
body.page-admin .xp-level-new-card input,
body.page-admin .xp-admin-selector-card select,
body.page-admin .premios-nivel-form select {
    width: 100% !important;
    min-width: 0 !important;
}

body.page-admin .xp-level-editor-fields small {
    display: block !important;
    margin-top: 0.3rem !important;
    line-height: 1.35 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

body.page-admin .xp-level-new-card {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(13rem, 1fr)) !important;
    width: min(100%, 58rem) !important;
    margin: 0 auto !important;
}

body.page-admin .xp-level-new-card legend {
    justify-self: start !important;
}

body.page-admin .xp-level-new-card .form-group:nth-of-type(5) {
    grid-column: 1 / -1 !important;
}

body.page-admin .premios-nivel-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem !important;
    width: 100% !important;
    margin-top: 1.25rem !important;
}

@media (max-width: 70rem) {
    body.page-admin .xp-level-new-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 52rem) {
    body.page-admin .xp-admin-selector-form,
    body.page-admin .xp-level-editor-card,
    body.page-admin .xp-level-editor-fields,
    body.page-admin .xp-level-new-card {
        grid-template-columns: 1fr !important;
    }

    body.page-admin .xp-level-icon-preview {
        width: min(100%, 7rem);
    }
}

/* Panel estudiante: orden de rankings del lateral */
body.page-panel .right-panel {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.95rem !important;
}

body.page-panel .right-panel > h3 {
    display: none !important;
}

body.page-panel .leaderboard-global-xp {
    order: 1 !important;
}

body.page-panel .leaderboard-xp-grupo {
    order: 2 !important;
}

body.page-panel .leaderboard-puntos-grupo {
    order: 3 !important;
}

body.page-panel .right-panel > .widget-extra {
    order: 4 !important;
}

/* Panel: centrado definitivo del medallero */
body.page-panel header.top-header .header-left > .mis-medallas {
    display: grid !important;
    place-items: center !important;
    align-self: center !important;
    justify-self: end !important;
    height: fit-content !important;
    min-height: 0 !important;
    padding: clamp(1rem, 1.4vw, 1.25rem) !important;
}

body.page-panel header.top-header .header-left > .mis-medallas > .mis-medallas-inner {
    width: min(100%, 19.75rem) !important;
    margin: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

body.page-panel header.top-header .mis-medallas .mis-medallas-head {
    width: 100% !important;
    justify-content: center !important;
    margin: 0 0 0.75rem !important;
}

body.page-panel header.top-header .mis-medallas .medallas-empty {
    margin: 0 0 0.9rem !important;
}

body.page-panel header.top-header .mis-medallas .medallas-lista {
    width: min(100%, 19.25rem) !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    place-items: center !important;
    place-content: center !important;
}

@media (max-width: 86rem) {
    body.page-panel header.top-header .header-left > .mis-medallas {
        justify-self: stretch !important;
    }
}

/* Pagina principal: Material de apoyo con portadas visuales */
.material-source-section,
.material-modal {
    --material-navy: var(--azul-oscuro);
    --material-graphite: #eef5fb;
    --material-cyan: #0b7ec2;
    --material-blue: var(--azul);
    --material-gold: #ffcc00;
}

.material-source-section .section-title h2,
#modal-material-titulo {
    letter-spacing: 0;
}

.material-list-shell {
    border: 1px solid rgba(0, 102, 179, 0.2) !important;
    border-radius: 1.5rem !important;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 0%, rgba(0, 102, 179, 0.08), transparent 18rem),
        radial-gradient(circle at 100% 12%, rgba(255, 204, 0, 0.1), transparent 16rem),
        linear-gradient(135deg, #ffffff, #f8fbff 58%, #eef5fb) !important;
    box-shadow: 0 1.5rem 3.25rem rgba(0, 30, 70, 0.14);
}

.material-intro-panel {
    padding: clamp(1.25rem, 3vw, 2.125rem) !important;
    border-bottom: 1px solid rgba(0, 102, 179, 0.14) !important;
    background:
        linear-gradient(90deg, rgba(0, 102, 179, 0.09), rgba(255, 204, 0, 0.08)),
        transparent !important;
}

.material-intro-panel::before {
    content: "Material de apoyo";
    display: inline-flex;
    margin-bottom: 0.625rem;
    padding: 0.3125rem 0.625rem;
    border: 1px solid rgba(0, 102, 179, 0.24);
    border-radius: 999px;
    background: rgba(0, 102, 179, 0.08);
    color: var(--azul-oscuro);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.material-intro-panel p {
    max-width: 54rem !important;
    color: #3d5368 !important;
    font-size: clamp(0.875rem, 1.3vw, 1rem) !important;
    line-height: 1.7 !important;
}

.material-summary span {
    border-color: rgba(0, 102, 179, 0.18) !important;
    background: #ffffff !important;
    color: var(--azul-oscuro) !important;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 30, 70, 0.08);
}

.material-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(15.625rem, 1fr)) !important;
    gap: clamp(1rem, 1.8vw, 1.5rem) !important;
    padding: clamp(1rem, 2.4vw, 1.75rem) !important;
}

.material-card {
    position: relative;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr auto;
    gap: 0 !important;
    align-items: stretch !important;
    min-width: 0;
    min-height: 100%;
    overflow: hidden;
    padding: 0 !important;
    border: 1px solid rgba(0, 102, 179, 0.16) !important;
    border-radius: 1.375rem !important;
    background:
        linear-gradient(180deg, #ffffff, #f8fbff),
        #ffffff !important;
    color: var(--azul-oscuro);
    box-shadow:
        0 1.125rem 2.25rem rgba(0, 30, 70, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.material-card:hover {
    transform: translateY(-0.3125rem);
    border-color: rgba(0, 102, 179, 0.34) !important;
    background:
        linear-gradient(180deg, #ffffff, #f2f8fe),
        #ffffff !important;
    box-shadow:
        0 1.5rem 2.875rem rgba(0, 30, 70, 0.16),
        0 0 0 1px rgba(0, 102, 179, 0.08),
        0 0 1.5rem rgba(0, 102, 179, 0.1) !important;
}

.material-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0;
    overflow: hidden;
    background: #eaf3fb;
}

.material-card-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform 260ms ease, filter 260ms ease;
}

.material-card:hover .material-card-image img {
    transform: scale(1.055);
    filter: saturate(1.12) contrast(1.05);
}

.material-card-image::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, transparent 45%, rgba(255, 255, 255, 0.18)),
        radial-gradient(circle at 18% 20%, rgba(0, 102, 179, 0.1), transparent 48%);
}

.material-card-badge {
    display: none !important;
}

.material-file-badge {
    display: none !important;
}

.material-card-copy {
    display: grid;
    align-content: start;
    gap: 0.625rem;
    min-width: 0;
    padding: 1.125rem 1.125rem 0.75rem !important;
}

.material-card h4 {
    margin: 0 !important;
    color: var(--azul-oscuro) !important;
    font-size: clamp(1.0625rem, 1.35vw, 1.25rem) !important;
    line-height: 1.18 !important;
}

.material-card p {
    margin: 0 !important;
    color: #475f77 !important;
    font-size: 0.8125rem !important;
    line-height: 1.55 !important;
}

.material-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4375rem;
    margin-top: 0.125rem !important;
}

.material-card-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(0, 102, 179, 0.16);
    border-radius: 999px;
    background: #eef7ff;
    color: var(--azul-oscuro) !important;
    font-size: 0.6875rem !important;
    font-weight: 800;
}

.material-card .material-btn {
    width: calc(100% - 2.25rem) !important;
    min-width: 0 !important;
    margin: 0.25rem 1.125rem 1.125rem;
    justify-self: stretch;
    text-align: center;
    background: linear-gradient(135deg, var(--azul), var(--azul-oscuro)) !important;
    color: #ffffff !important;
    box-shadow: 0 0.75rem 1.75rem rgba(0, 102, 179, 0.22);
}

.material-card .material-btn:hover {
    background: linear-gradient(135deg, #0877c7, var(--azul-oscuro)) !important;
    box-shadow: 0 0.9375rem 1.875rem rgba(25, 199, 243, 0.24);
}

.material-modal .apoyo-modal,
.material-modal.apoyo-modal {
    width: min(73.75rem, 100%) !important;
}

@media (min-width: 88.75rem) {
    .material-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 56.25rem) {
    .material-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 38.75rem) {
    .material-grid {
        grid-template-columns: 1fr !important;
        padding: 0.875rem !important;
    }

    .material-card-copy {
        padding: 1rem 1rem 0.625rem !important;
    }

    .material-card .material-btn {
        width: calc(100% - 2rem) !important;
        margin: 0.25rem 1rem 1rem;
    }
}

/* Admin final: tablero organizado por areas de trabajo */
body.page-admin .admin-dashboard-groups {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: clamp(0.85rem, 1.35vw, 1.2rem) !important;
    align-items: stretch;
    margin-bottom: clamp(1rem, 2vw, 1.6rem) !important;
}

body.page-admin .admin-module-category {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: clamp(0.8rem, 1.4vw, 1.2rem);
    min-width: 0;
    padding: clamp(0.95rem, 1.6vw, 1.25rem);
    border: 0.0625rem solid rgba(0, 51, 102, 0.14);
    border-left: 0.35rem solid var(--azul);
    border-radius: var(--radio-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 254, 0.96)),
        radial-gradient(circle at right top, rgba(255, 204, 0, 0.13), transparent 16rem);
    box-shadow: 0 1rem 2.2rem rgba(0, 30, 70, 0.08);
}

body.page-admin .admin-module-category > span {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    min-width: 4.4rem;
    min-height: 2.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999rem;
    background: var(--azul);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 85, 153, 0.16);
}

body.page-admin .admin-module-category h2 {
    margin: 0;
    color: var(--azul-oscuro);
    font-size: clamp(1.1rem, 1.55vw, 1.45rem);
    line-height: 1.15;
}

body.page-admin .admin-module-category p {
    margin: 0.25rem 0 0;
    color: #5c6f82;
    font-size: clamp(0.86rem, 1vw, 0.95rem);
    line-height: 1.45;
}

body.page-admin .admin-module-category-web {
    order: 10;
}

body.page-admin .admin-module-card.module-web {
    order: 11;
}

body.page-admin .admin-module-category-users {
    order: 20;
}

body.page-admin .admin-module-card.module-users {
    order: 21;
}

body.page-admin .admin-module-category-game {
    order: 30;
}

body.page-admin .admin-module-card.module-game {
    order: 31;
}

body.page-admin .admin-dashboard-groups .admin-module-card {
    grid-column: span 3;
    min-height: 8.4rem;
    padding: clamp(0.95rem, 1.25vw, 1.15rem);
    border-top: 0.28rem solid var(--azul) !important;
    background:
        linear-gradient(180deg, #ffffff, #f8fbff),
        #ffffff !important;
}

body.page-admin .admin-dashboard-groups .admin-module-card::after {
    content: "";
    position: absolute;
    right: -2.2rem;
    bottom: -2.2rem;
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    background: rgba(0, 102, 179, 0.06);
    pointer-events: none;
}

body.page-admin .admin-dashboard-groups .admin-module-card span {
    background: rgba(0, 102, 179, 0.08) !important;
    color: var(--azul-oscuro) !important;
    font-weight: 900 !important;
}

body.page-admin .admin-dashboard-groups .admin-module-card:hover,
body.page-admin .admin-dashboard-groups .admin-module-card:focus-visible,
body.page-admin .admin-dashboard-groups .admin-module-card.is-active {
    transform: translateY(-0.18rem);
    border-color: rgba(0, 102, 179, 0.32) !important;
    box-shadow: 0 1.15rem 2.25rem rgba(0, 51, 102, 0.14) !important;
}

body.page-admin .admin-dashboard-groups .admin-module-card.is-active {
    border-top-color: var(--dorado) !important;
}

body.page-admin .admin-modal-body > .admin-section-card {
    gap: clamp(0.9rem, 1.6vw, 1.35rem) !important;
    padding: clamp(1rem, 2vw, 1.6rem) !important;
    background:
        linear-gradient(180deg, #ffffff, #f8fbff),
        #ffffff !important;
}

body.page-admin .admin-modal-body > .admin-section-card > div:first-child {
    padding: clamp(0.9rem, 1.5vw, 1.15rem);
    border: 0.0625rem solid rgba(0, 51, 102, 0.12);
    border-left: 0.32rem solid var(--azul);
    border-radius: var(--radio-lg);
    background: linear-gradient(135deg, rgba(0, 102, 179, 0.055), rgba(255, 204, 0, 0.07));
}

body.page-admin .admin-modal-body > .admin-section-card > div:first-child h2 {
    margin-bottom: 0.35rem !important;
    font-size: clamp(1.2rem, 1.65vw, 1.55rem) !important;
}

body.page-admin .admin-modal-body > .admin-section-card > div:first-child p {
    max-width: 70rem;
    color: #53677b !important;
    line-height: 1.55;
}

body.page-admin .admin-modal-body form,
body.page-admin .admin-modal-body .lista-usuarios,
body.page-admin .admin-modal-body .admin-table-wrap,
body.page-admin .admin-modal-body .contenido-admin-layout,
body.page-admin .admin-modal-body .tienda-admin-grid,
body.page-admin .admin-modal-body .practicas-admin-grid,
body.page-admin .admin-modal-body .medallas-admin-grid,
body.page-admin .admin-modal-body .banner-admin-form {
    border-radius: var(--radio-lg);
}

/* Aula Visual: tarjetas de video limpias dentro del modal de administrador */
body.page-admin #admin-guia-videos .tienda-admin-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.25rem), 1fr)) !important;
    gap: 1rem !important;
    align-items: stretch !important;
}

body.page-admin #admin-guia-videos .guia-video-admin-card {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
    min-width: 0 !important;
    padding: 0.9rem !important;
}

body.page-admin #admin-guia-videos .guia-video-preview {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    min-height: 8.75rem;
    overflow: hidden !important;
    border-radius: var(--radio-md) !important;
    border: 0.0625rem solid var(--template-border) !important;
    background: #eef6fc !important;
}

body.page-admin #admin-guia-videos .guia-video-preview iframe {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

body.page-admin #admin-guia-videos .guia-video-admin-card > div:not(.guia-video-preview) {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.3rem !important;
    min-width: 0 !important;
}

body.page-admin #admin-guia-videos .guia-video-admin-card h3 {
    margin: 0 !important;
    font-size: 1rem !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
}

body.page-admin #admin-guia-videos .guia-video-admin-card p {
    margin: 0 !important;
    font-size: 0.84rem !important;
    line-height: 1.4 !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

body.page-admin #admin-guia-videos .tienda-admin-actions {
    margin-top: 0.45rem !important;
}

@media (max-width: 42rem) {
    body.page-admin #admin-guia-videos .tienda-admin-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 92rem) {
    body.page-admin .admin-dashboard-groups .admin-module-card {
        grid-column: span 4;
    }
}

@media (max-width: 64rem) {
    body.page-admin .admin-dashboard-groups .admin-module-card {
        grid-column: span 6;
    }

    body.page-admin .admin-module-category {
        align-items: flex-start;
    }
}

@media (max-width: 42rem) {
    body.page-admin .admin-dashboard-groups {
        grid-template-columns: 1fr !important;
    }

    body.page-admin .admin-module-category,
    body.page-admin .admin-dashboard-groups .admin-module-card {
        grid-column: 1 / -1;
    }

    body.page-admin .admin-module-category {
        flex-direction: column;
    }

    body.page-admin .admin-module-category > span {
        min-width: 0;
    }
}
